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.

AppGameKit Classic Chat / Screen Optimization for Phone Screens and Tablets

Author
Message
THE_NOTORIOUS_PIGGY
8
Years of Service
User Offline
Joined: 17th Jun 2016
Location:
Posted: 4th Jul 2016 17:44
Hey, what are some of the ways i can get my app to work both on phones and tablets without having to make a separate app?
My game is played in landscape mode, and it is 800 x 480 on a 16:9 resolution.
Right now I don't have access to a tablet, because I am abroad, so i can only test on my phone.
From my knowledge, this is what I tried doing.
SetScreenScissor(0,0,0,0) = from what I know this keeps the game at at the same resolution, but removes the black bars. Is a tablet is at a 1920 X 1080 resolution, will my game look something like this? http://prntscr.com/bopojd

I have also tried this in a function
x = GetDeviceWidth ()
y = GetDeviceHeight ()

SetScreenResolution(x,y)

It works perfectly for devices with the same aspect ratio, but since tablets and ipads tend to be 4:3 that doesn't help.

What are my options to suit my app? Many thanks




BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Jul 2016 18:10
Small code snippet to help here - http://steamcommunity.com/app/325180/discussions/0/351660338708863179/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 4th Jul 2016 18:11
Hi.

if your want make a game for android, and if you want to run game on all platform, I suggest, use SetDisplayAspect(-1). then you don't need use SetScreenScissor(0,0,0,0) command for fix black bars.

this is and example :



Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th Jul 2016 18:19 Edited at: 4th Jul 2016 18:21
i not like a stretch screen, with SetScreenScissor(0,0,0,0) you will see the outer area from VirtualResolution, means you can fill it too
you can get the other border with this commands to align the game gui
GetScreenBoundsBottom ()
GetScreenBoundsLeft ()
GetScreenBoundsRight ()
GetScreenBoundsTop ()

here you can use 160,90 or just a pixel size 1920,1080
SetVirtualResolution ( iWidth, iHeight )
GetVirtualHeight ()
GetVirtualWidth ()
maybe let the user can choose 4:3 or 16:9, (btw 4:3 fit inside a 16:9)
AGK (Steam) V2.0.19 : Windows 10 Pro 64 Bit : AMD (16.3.2) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-11-25 05:17:09
Your offset time is: 2024-11-25 05:17:09