Virtual Keys, Ads and GUI Size in GameMaker

Just a quick note about making sure virtual keys and ads are placed where you expect in your GameMaker game. If you have something like this in a 960×540 resolution game:

virtual_key_add(0, 420, 256, 120, vk_left);
virtual_key_add(704, 420,  256, 120, vk_right);

which places two virtual keys towards the bottom of the screen, then you’ll need to call display_set_gui_size(960,540) (or whatever your game’s resolution is) to ensure the keys are placed at the same relative position for devices with different resolutions. The same goes for placing ads on the screen.

Advertisements