Jump to content


Photo

How to make game for different resolutions?


  • Please log in to reply
3 replies to this topic

#1 KozKoz

KozKoz

    GMC Member

  • New Member
  • 4 posts
  • Version:GM:HTML5

Posted 13 April 2012 - 02:18 AM

Hello there!

I want my game to be played in different devices in browser.

So, What do you advise? :thumbsup:

Edited by KozKoz, 13 April 2012 - 03:16 AM.

  • 0

#2 KozKoz

KozKoz

    GMC Member

  • New Member
  • 4 posts
  • Version:GM:HTML5

Posted 13 April 2012 - 05:21 AM

So, I decided to change html-code and css generated by GM manually. But there are several difficulties with resizing canvas element and keeping aspect ratio. And I will try to pass them.
  • 0

#3 Centauri

Centauri

    GMC Member

  • GMC Member
  • 116 posts

Posted 13 April 2012 - 11:28 AM

A technique that I've been using is to make the room size some arbitrarily large value like 1960x1080 then using window_center() to place the canvas in the centre of the browser, making it essentially fullscreen. Then you can use room_width, room_height, browser_width and browser_height to find the coordinates of the top left corner of the screen and place objects relative to that, for example:

STEP EVENT:
window_center();
x0 = max(0, (room_width - browser_width) / 2);
y0 = max(0, (room_height - browser_height) / 2);

  • 0

#4 cutch23

cutch23

    GMC Member

  • GMC Member
  • 25 posts
  • Version:Unknown

Posted 09 July 2012 - 12:42 AM

A technique that I've been using is to make the room size some arbitrarily large value like 1960x1080 then using window_center() to place the canvas in the centre of the browser, making it essentially fullscreen. Then you can use room_width, room_height, browser_width and browser_height to find the coordinates of the top left corner of the screen and place objects relative to that, for example:

STEP EVENT:
window_center();
x0 = max(0, (room_width - browser_width) / 2);
y0 = max(0, (room_height - browser_height) / 2);


I'm a total noob here, I don't quite understand what x0 and y0 are.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users