Gamemaker Virtual keys on different screen resolution
Hello all,
Currently I am developing an android game. The controls are virtual keys positioned like view_xview[0]+20, view_yview[0]+20, which mostly does the trick expect that on different devices, the virtual keys are drawn in different places.
I am drawing icons above the virtual keys to represent buttons which do the same thing.
Does anyone know of a tutorial that deals with this sort of problem?
A demo of the apk can be found at www.broken-skies.com/broken1.apk
Currently I am developing an android game. The controls are virtual keys positioned like view_xview[0]+20, view_yview[0]+20, which mostly does the trick expect that on different devices, the virtual keys are drawn in different places.
I am drawing icons above the virtual keys to represent buttons which do the same thing.
Does anyone know of a tutorial that deals with this sort of problem?
A demo of the apk can be found at www.broken-skies.com/broken1.apk
Comments
What's the problem - are your graphics not using relative co-ordinates as well?
Surely there must be other values for screen size and height that are device based, like the window_* calls?
The virtual keys:
virtualLeft = virtual_key_add(view_xview+10, view_yview+550, 80, 80, ord('Q'));
virtualRight = virtual_key_add(view_xview+151, view_yview+550, 80, 80, ord('W'));
virtualFire = virtual_key_add(view_xview+846, view_yview+550, 100, 100, ord('O'));
the drawing of the buttons:
draw_sprite(sprLeftTurn,0,view_xview+10,view_yview+550)
draw_sprite(sprTurnRight,0,view_xview+151,view_yview+550)
draw_sprite(sprFire,0,view_xview+846,view_yview+550)
Thanks for putting me onto window_ calls. I will check to see if I cant use these.
The game is on the play store https://play.google.com/store/apps/details?id=com.companyname.BrokenSkies&hl=en