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.

Newcomers AppGameKit Corner / Retina displays

Author
Message
pjsmith67
8
Years of Service
User Offline
Joined: 2nd Feb 2016
Location: Nebraska, USA
Posted: 2nd Feb 2016 22:39
Hi, I've just started messing around with AppGameKit and I like what I see so far. I see that AppGameKit automatically scales graphics for different resolutions, however upscaling is not always the best thing.

Other development tools allow you to select different size graphics (image.png,image@2x.png, etc...) depending on the resolution. Is there an example somewhere of how to do that in AppGameKit?

Will it do it automatically or do I have to manually check resolutions then decide what size graphic to use?

Thanks!

Phil
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Feb 2016 08:54
Welcome

What you need is this command...

SetIntendedDeviceSize

Description
Sets the size of the device you have designed all your artwork for, this allows AppGameKit to downsize the images to save memory on lower resolution devices. Note that commands such as SetSpriteAnimation that might assume image sizes must account for images that have been reduced. For example loading a 512x512 image and using SetSpriteAnimation(spr,128,128,16) should instead use SetSpriteAnimation(spr,GetImageWidth(img)/4,GetImageHeight(img)/4,16) in case the image is no longer 512 in size.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 3rd Feb 2016 10:59
You can probably also use GetDeviceHeight and GetDeviceWidth to check screen resolution, and then load in the appropriate media based on the results. i.e.

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
pjsmith67
8
Years of Service
User Offline
Joined: 2nd Feb 2016
Location: Nebraska, USA
Posted: 3rd Feb 2016 16:09
Thanks guys! I know what to do now.

Phil

Login to post a reply

Server time is: 2024-04-20 13:17:38
Your offset time is: 2024-04-20 13:17:38