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 / sprites appear too large

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Nov 2011 08:24 Edited at: 23rd Nov 2011 08:29
Here's my code for displaying a sprite on screen in AGK. Resolution is set at 640x320 and the sprite is way too large.


The sprite is only 32x32 pixels, and as you can see in the image it looks just fine at the same resolution in DBP. I checked the size in photoshop and it seems to be scaled up exactly 3x large in AppGameKit, 96x96.





Alright, think I fixed it. Had to call setVirtualResolution. So what's the point of setting the values in setup.agc?

"You're not going crazy. You're going sane in a crazy world!" ~Tick

Attachments

Login to view attachments
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 23rd Nov 2011 08:33 Edited at: 23rd Nov 2011 08:35
It's because you're using the SetDisplayAspect instead of the SetVirtualResolution command. So either replace the former with the latter or try this:


In short this works out the ratio difference and scales the sprite accordingly.

Edit- forgot to mention two things:
1. When you use the percentage resolution (ie setdisplayaspect) it treats the window as 100x100 instead of the dimensions you see in the setup.agc.
2. I haven't actually run the code but it is based off what I used in my projects.

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 23rd Nov 2011 23:49 Edited at: 23rd Nov 2011 23:50
Quote: "Alright, think I fixed it. Had to call setVirtualResolution. So what's the point of setting the values in setup.agc?"

Its more or less an resolution you get while coding in windows.
Its pretty hard to debugg your game in windows if its 320x240 in an high resolution in windows.
You can also test how your game gets scaled on various devices.
Are you working on an remake of the amiga clasic ?
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 24th Nov 2011 00:46
Quote: "Quote: "Alright, think I fixed it. Had to call setVirtualResolution. So what's the point of setting the values in setup.agc?"
Its more or less an resolution you get while coding in windows."

I actually think that it sets the physical resolution of the application and then you get to set virtual resolutions or use the percentage system. On windows the values in the setup.agc file determine the size of the window if in windowed mode.

Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 24th Nov 2011 15:44
Set virtual resolution, sets the resolution your game is working with internally in the game.

The config file sets the resolution of your windows-device, the resolution the windows program is emulating.

Mobiles and tabs all have different resolutions, therefore the windows program should be able to have the same.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.

Login to post a reply

Server time is: 2024-11-22 14:47:55
Your offset time is: 2024-11-22 14:47:55