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 / still confuse in mobile responsiveness

Author
Message
Shonne
7
Years of Service
User Offline
Joined: 24th Jun 2016
Location:
Posted: 28th Jun 2016 10:20
this is the message i read:

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

can someone show me an example of codes that would clearly state everything ?
also just a simple code that shows the sprite responsiveness too and its location ? thank you so much.
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 29th Jun 2016 21:32 Edited at: 29th Jun 2016 21:34
This is pretty much the code I use when setting up the screen resolution



I hard code an initial resolution then determine the screen bounds then use those screen bounds with the setscissor command. I then calculate the new screen width and height.

By keeping the screen boundary values in variables they can be use to detect when sprites go off the screen or for positioning HUD elements and so on..

Hope this makes sense.
Hover Car Race Challenge! - available now on Google Play
Invaders of the 29th Dimension - available now on Google Play
Find me on indieDB

Login to post a reply

Server time is: 2024-03-29 14:18:44
Your offset time is: 2024-03-29 14:18:44