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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s