Hey there! I’m trying to resize some UI components based on the aspect ratio of a screen as per this post, but as a coding ametuer I’m not quite sure how to use the snippet @Seb gave in that post.
(For quick reference, here’s the snippet:
let aspectRatio : number;
Z.screen.on("resize",(height,width)=>aspectRatio = height/width);
)
I also noticed in the Docs that there’s something listed as Z.ScreenSizeConstrain but I’m not sure if this is what I’m looking for, or even how I would use it.
Really, we’re just trying to make something to resize some elements on a tablet versus a phone, as users for our project will likely have both devices in use at some point.
EDIT: I managed to find this post in which @howiemnet 's code seemed to work for now. Going to test it more to make sure I realy understand what’s happening with the code, but it’s a promising start!