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 / SetVirtualResolution query

Author
Message
Euphoria
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: United Kingdom
Posted: 2nd Sep 2011 16:41
Hi all,

Just got the AppGameKit and been trying to learn up on the teir 1 side of things. Just when I thought I had worked out the resolution / display side I come across this.

If I designed my GFX at a res of 1024 x 600. Then in my project setup I set it to 1024 x 600 and lastly I use the following:

SetVirtualResolution( 1024, 600 )
SetDisplayAspect( 1024/600 )

Shouldnt I expect a sprite that is 1024 pixels wide to take up the entire width of the window (which is 1024 wide). When I try it the sprite (and any other sprites for that matter) are shrunk down leaving borders on the left & right.

Makes me think I am doing something wrong or not understanding the whole virtual resolution thing correctly.

Heres a screeny if it helps....


Thanks for any input to help me lift this fog

Attachments

Login to view attachments
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 2nd Sep 2011 16:44
The SetDisplayAspect() call is redundant as SetVirtualResolution() automatically sets the aspect ratio to your chosen resolution.

In this case I think the error is cause by 1024/600 producing and integer result instead of a float one, 1024.0/600.0 might fix it, but removing the call altogether should work.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 2nd Sep 2011 16:47
Thanks paul as i whas fooling around with this last night!

Then do i only nead set virtual resolution
Euphoria
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: United Kingdom
Posted: 2nd Sep 2011 16:48
you were right it was an integer rounding issue on the aspect, and also removing it works all happy again

Many thanks

Login to post a reply

Server time is: 2024-11-21 17:57:01
Your offset time is: 2024-11-21 17:57:01