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 vs. window resolution

Author
Message
Nickydude
Retired Moderator
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 16th Aug 2011 00:39
How do I resize the actual screen window to the setvirtualresolution size? I have a setvirtualresolution of 480,800 and setting a sprite to position 0,0 actually places it about a fifth of the way in at the top of the screen.

I reject your reality and substitute my own...
Nickydude
Retired Moderator
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 16th Aug 2011 00:43
Also, is it possible to change screen orientation (like when you're creating a new project) mid project?

I reject your reality and substitute my own...
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Aug 2011 01:11
There's a command, SetOrientationAllowed() that will determine if your app will change when the device is rotated. If you allow it to change when rotated, AppGameKit automatically handles the rotation of your app.

The sprites are positioned from the upper left corner of the sprite. (including parts that should be transparent)

If you use SetSpriteOffset() and set it to the middle of the sprite, or some other offset you would prefer, then you can use SetSpritePostiionByOffset() to position it where you want.

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 16th Aug 2011 01:12
There is a setup.agc file created with a new project that allows you to specify the window size on those platforms that are not fullscreen.

Whilst you can call SetVirtualResolution mid project to change the shape of your screen it would be a lot of work as you'd have to recalculate all your sprite positions. Mobile devices that have accelerometers will automatically rotate your game to their current orientation without adjusting your resolution. This can be controlled with SetOrientationAllowed().

Login to post a reply

Server time is: 2024-03-28 15:36:55
Your offset time is: 2024-03-28 15:36:55