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 / problem with game sizes.

Author
Message
Shonne
8
Years of Service
User Offline
Joined: 24th Jun 2016
Location:
Posted: 29th Jun 2016 10:46
can someone post some example code snippet that make the game be full screen on all devices please..i just downloaded the AppGameKit 2 and still very new to the environment.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th Jun 2016 11:14 Edited at: 29th Jun 2016 11:15
Shonne
8
Years of Service
User Offline
Joined: 24th Jun 2016
Location:
Posted: 29th Jun 2016 11:34
i have done reading it. I am not new to basic programming, im just new to mobile game programming.. and currently first thing that im still figuring out is how to make the mobile game to be full screen on different mobile devices, because mobile devices have different resolutions.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th Jun 2016 12:19
I think I posted somewhere else on this topic...

Resolution is not an issue. You set the virtual resolution - SetVirtualResolution() - and AppGameKit will scale it to fit any device.

The only issue is if you do not want black bars on devices that have a different aspect ratio to the one you designed for. For example watching a cinematic film on a TV gives you black bars top and bottom, because it was designed for a much wider aspect.
In this case, use the command SetScissor(0,0). This will remove the black bars, and extend the play area to fit the full screen. Just remember that when something goes off-screen, it may still be visible on devices with a different aspect. Therefore, make sure they are still presentable within the margins of your screen.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Shonne
8
Years of Service
User Offline
Joined: 24th Jun 2016
Location:
Posted: 29th Jun 2016 14:42
nothing happens even there is already a setscissor(). the black borders are not removed.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th Jun 2016 15:53
Try this code first. It is a screen size of 1024 x 768. The virtual resolution is wider and shorter, so you get 2 black borders, simulating what might happen on different phones.

Then run it a second time, but uncomment the setScissor() line. Now you have no borders.
To make this work, my white background sprite had to be bigger than the default screen size, so that it would cover any area exposed by the setScissor() action.



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Login to post a reply

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