• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Dynamic Menu Positioning (approach)

L

LWDIV

Guest
Hello @ll, i just started to collect information about creating a menu what fits to a resizable window. I defined an "ideal_height" = 1388 pixels and i am using a "display_manager"-script to calculate my aspect-ratio to match the screen size. On my Samsung s10 e i am getting a full size of 694x1388 pixels. I am postioning my Menu-Elements in a Room with a fixed size 720x1388 pixels (maybe not right also). When I postion a Button on the right bottom Corner, it gets cutted (goes out of the screen) by the new "Resolution".

I searched in the Forum but i couldnt find any Thread what helps. Is there any good approach to position Menu-Items dynamicly on the given Screensize withour loosing the look and feel (something that matches most of mobile screen sizes)?

Basicly i came up with an Idea to use the MP-Grid. But i dont know if its the right way(to split the Screen into 3 parts two of them will be fixed and the middle one will be resizable to fit most of the screens).

I thank you in advance for your help!
 
R

robproctor83

Guest
Are you not using the GUI? Things that are fixed like this should be generated in the GUI if possible. When you place an item in the GUI you place it on the respective side to it's position. So if you wanted something to be on the right side you wouldn't just put 500 or something, you would get the width of the view and draw from the right edge. So instead of 500 you would write _view_width - sprite_width - 20 (20 pixels from the right). For center you would take the view width and divide by 2. Using mp for this kind of thing doesn't seem necessary.
 
Top