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 / Portrait mode with percentage system

Author
Message
jlahtinen
14
Years of Service
User Offline
Joined: 26th Oct 2009
Location: Finland
Posted: 6th May 2016 18:41
I'm making my first portair-app and I cannot get it to work properly.

In Windows there is black borders on top and bottom and in phone the sprites are all messed up.

What to do? I'm using AKG2 with tier 1 (basic).
jlahtinen
14
Years of Service
User Offline
Joined: 26th Oct 2009
Location: Finland
Posted: 6th May 2016 19:55
There seems to be some oddities on virtual resolutions also. 720x1280 should be same aspect ration than 1080x1920 and 1440x2560, but there is black borders on higher resolution phones (bigger in 1080p than 1440p which is odd).

Bugs or what?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 7th May 2016 07:45
Please show your code that sets this up and a screenshot. It will be easier to help you out.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 19th Jun 2016 23:25
If the phone has a different width to height ratio than the virtual resolution that you are using, there will be black bars either above and below or left and right.

You can actually draw in those spaces.

Use the command SetScissor(0,0,0,0) after setting your virtual resolution.

To hide the bars on devices that don't have the same width to height ratio, I center my background image (or animation) and create it so that it is larger than my virtual resolution.

You can specify positions with negative X or Y to put an image, text or sprite to the left or above, respectively, the main display. Similarly when the position is past the right or bottom. If a device has a ratio different from your resolution, the image/sprite/text may appear where the black bars would be.
Cheers,
Ancient Lady
jlahtinen
14
Years of Service
User Offline
Joined: 26th Oct 2009
Location: Finland
Posted: 21st Jul 2016 10:05
AGK v1 asked if I wanted to make Portrait or Landscape program. AKG2 doesn't.

Can someone show how to make portrait program with percentage system that it fills the entire screen?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 21st Jul 2016 23:22
This is a very simple piece of code to display a splash screen in portrait mode across devices with different aspects. It may not be the right way to do it but it's the way i did it.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-20 05:13:32
Your offset time is: 2024-04-20 05:13:32