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.

Windows / [SOLVED] AppGameKit Tier 2 Incorrectly Creating Sprites from Images

Author
Message
Eqqman
9
Years of Service
User Offline
Joined: 15th Jul 2015
Location:
Posted: 17th Feb 2019 17:31
Hello- if I use the LoadSprite() function in the Tier 1 editor on a 64 x 64 PNG file, the sprite is created correctly. But if I use this function in Tier 2 (Visual Studio 2017, Windows 10) I end up with a sprite that is 64 x 42 (and the graphic has been shrunk, not clipped). If instead I do LoadImage() and then CreateSprite() from that image, the debugger tells me that the image object is 64 x 64 but I still end up with a 64 x 42 sprite. If I create a memblock by hand, create an image from the memblock, and then create a sprite, the sprite is correct at 64 x 64. Has anyone seen similar behavior, and if so, how can it be corrected?
Goo Goo G\'Joob!

The author of this post has marked a post as an answer.

Go to answer

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Feb 2019 21:14 Edited at: 18th Feb 2019 21:16
Can you post some code?
Eqqman
9
Years of Service
User Offline
Joined: 15th Jul 2015
Location:
Posted: 19th Feb 2019 04:41
This post has been marked by the post author as the answer.
Found the issue by accident (and after spending a day writing code to import BMP files to make memblocks by hand). If I create sprites and then invoke agk::SetVirtualResolution, these sprites become distorted, but any sprites created after agk::SetVirtualResolution are fine.

This does leave me wondering what will happen on a mobile device to my sprites if I allow the orientation of the device to change...
Goo Goo G\'Joob!

Login to post a reply

Server time is: 2024-11-21 09:58:09
Your offset time is: 2024-11-21 09:58:09