Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Game Responsiveness in Mobile phones

Author
Message
Shonne
8
Years of Service
User Offline
Joined: 24th Jun 2016
Location:
Posted: 24th Jun 2016 04:19
can anyone tell me what are the steps to make the game size responsive on every mobile phones/tablets. Thank you.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Jun 2016 07:06
In AppGameKit, you use a virtual resolution, so it will fit all screen sizes. There are 2 things to consider:

1. Changing from Portait to Landscape or vice-versa. In this scenario you need to rearrange everything on screen. But nearly all games only work in one orientation, I would always consider using one orientation only.
2. Different aspect ratios, where you get black bars if the screen width/height ratio differs. If this is an issue, you can use SetScissor() to lose the black bars, but make sure your screen content goes beyond the virtual resolution you have set. For example on the left side of the screen, 0 to -50 might now be visible.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Shonne
8
Years of Service
User Offline
Joined: 24th Jun 2016
Location:
Posted: 25th Jun 2016 12:57
how do i change the template to portrait or landscape? because in AGK2 there is no auto select what template orientation to use..
Shonne
8
Years of Service
User Offline
Joined: 24th Jun 2016
Location:
Posted: 25th Jun 2016 13:20
is this a good approach?

SetWindowSize( 1024, 768, 0 )

width = GetDeviceWidth ( )
height = GetDeviceHeight ( )
// set display properties
SetVirtualResolution( width, height )
SetOrientationAllowed( 1, 0, 0, 0 )

Login to post a reply

Server time is: 2024-11-23 22:28:10
Your offset time is: 2024-11-23 22:28:10