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 / Unable to use the entire screen for game

Author
Message
JORGEMAL
15
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 31st May 2013 20:39
I want my game to be displayed in the entire screen of a device. However, two black areas are shown on each side of the screen (image attached for reference). The two numbers at the top of the screen represent the actual resolution. I am using the percentage based positioning system. I modified the dimensions in the setup code as follows:



I have the following function for resolution initialization for my game:



How can I get the app to be displayed in the entire screen without showing the black areas in both sides?

Regards,
Jorge Maldonado

Attachments

Login to view attachments
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 31st May 2013 21:11
Quote: "rem Specify the initial device width
width=GetDeviceWidth()

rem Specify the initial device height
height=GetDeviceHeight()"

You can't do this, you have to type an actual number. And the setup.agc file only affects windows apps. Native apps are always fullscreen.

Don't forget to use the SetVirtualResolution command as well.

This is my current project, check it out! [href]forum.thegamecreators.com/?m=forum_view&t=204576&b=8[/href]
This is my website, check it out! [href]http:\\www.TeamDefiant.co.uk[/href]
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 31st May 2013 21:17 Edited at: 31st May 2013 21:19
this should get a float value
x#=GetDeviceWidth()
y#=GetDeviceHeight()
a#=x#/y#
SetDisplayAspect(a#)

with SetScissor(0,0,0,0)
you see the outside "screen" area.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 31st May 2013 21:48
you have new commands to get the screen bounds when using full screen with scissor.

the left edge is often negative under 0 so they are usefull.

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
JORGEMAL
15
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 1st Jun 2013 01:12 Edited at: 1st Jun 2013 01:57
Quote: "with SetScissor(0,0,0,0)
you see the outside "screen" area."


How is the SetScissor() used?
I do not see any example in the documentation and, as far as I understand, such command should be placed before/after each Sync().

Quote: "x#=GetDeviceWidth()
y#=GetDeviceHeight()
a#=x#/y#
SetDisplayAspect(a#)"


The above solution worked only if I start the game with the device in landscape orientation. If I run it in portrait orientation then the 2 big black areas at each side appear and it looks like in portrait mode even if I turn the device to landscape.

Regards,
Jorge Maldonado
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 1st Jun 2013 05:10
Quote: "How is the SetScissor() used?"

The way I use it (and the way it is mentioned here) is to allow access to the black bar areas of the display.

It works nicely when in virtual resolution mode. I even have the scores page set to use all of the space, not just the <width> by <height> area defined by the setvirtualresolution.

I don't quite know how it would work in the percentage system.

But I think the SetDisplayAspect command is supposed to work with the percentage system so that there aren't the black bars above/below or right/left.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st Jun 2013 10:48
if you use SetScissor u need only once.

Cliff means this commands
GetScreenBoundsBottom
GetScreenBoundsLeft
GetScreenBoundsRight
GetScreenBoundsTop

at my last test the return values from
GetDeviceWidth()
GetDeviceHeight()
turned with the device.

just test self
JORGEMAL
15
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 4th Jun 2013 19:32
Quote: "x#=GetDeviceWidth()
y#=GetDeviceHeight()
a#=x#/y#
SetDisplayAspect(a#)"


I implemented the above solution and now I can see the whole screen when I run my game and my device is initially in landscape orientation. However, if I run my game and my device is initially in portrait orientation, then only a small part of the scren is shown (2 big black areas left and right). This behavior remains even if I turn my device to landscape orientation.

Regards,
Jorge Maldonado
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 4th Jun 2013 19:40 Edited at: 4th Jun 2013 19:41
the "SetOrientationAllowed" command doesn't work for you ? it should force the orientation.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Jun 2013 20:17
And did you remember to do all the right settings in Xcode?

Somewhere they are posted a lot.

And I even figured out how to force v10812 Android to go straight to landscape.

Or don't you care if the app is landscape or portrait? Then there are different things to consider.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JORGEMAL
15
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 4th Jun 2013 21:40
Quote: "the "SetOrientationAllowed" command doesn't work for you ? it should force the orientation."


This is my initialization code, and it seems that the SetOrientationAllowed command is not working as expected.




Quote: "And did you remember to do all the right settings in Xcode?"


I understand that Xcode is for iOS only. Am I correct? if so, then I suppose this does not apply because I am generating an Android app.

By the way, I have version 1076 installed.

Regards.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Jun 2013 22:13 Edited at: 4th Jun 2013 22:14
Okay, there is also a way to fix the orientation in Android. It is done in the AndroidManifest.xml file.

Look for the line with 'android:screenOrientation' and change the value to 'sensorLandscape' to allow either landscape orientation or 'landscape' or 'reverseLandscape' for agk orientation 3 and 4, respectively.

Then make sure that setting is part of every '<activity' definition. It goes inside each group starting with '<activity'. It works fine if it is the last entry before the '>' or '/>' that closes the '<activity'.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JORGEMAL
15
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 5th Jun 2013 20:34
Perfect. My screen and orientation issues are now solved.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Jun 2013 20:50
Excellent!

Happy Programming!

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-11-24 15:43:43
Your offset time is: 2024-11-24 15:43:43