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 Studio Chat / LoadSubImage/SetSpriteAnimation Fail!

Author
Message
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 18th Aug 2021 18:00
I packaged my texture atlas with Texture Packer with max size set, the output image is non POT, AppGameKit reported that one of my tile sets is not big enough to contain the amount of tiles specified in SetSpriteAnimation but it does, I can count to 12 by myself just fine and all the tiles are 16x16px, even I ant balls that math up.

the atlas also contains 3 other tile sets of the same dimensions which load fine, out of the 20 or so sub images this is the only one reporting errors.

After checking my code 100 times and swearing quite a lot I reexported the spritesheet with fixed size POT (2048x2048) and AppGameKit loads it fine but now I have a massive image I do not need, I know AppGameKit expects POT images for things like UV scrolling and such but is this really a requirement for loading tilesets and spritesheets from a texture atlas with LoadSubImage??? and if so why does AppGameKit only report this error on a single image when 3 other images are just variations of the one that fails, if I comment that line out it still loads fine minus a tileset of course?

and no, I cant provide example code as any attempt to recreate this issue outside my project just results in everything working and I can not post the project as it contains licenced artwork, could a dev take a look at the project and give some feedback?

Open Source plugins
Cl - DnD Plugin
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 19th Aug 2021 06:54
Quote: "any attempt to recreate this issue outside my project just results in everything working"


That right there says that the issue is in your code.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 19th Aug 2021 16:21
Yeah I get what you are saying and outside looking in I would have said the same, but ...

Quote: "I reexported the spritesheet with fixed size POT (2048x2048) and AppGameKit loads it fine"


That right there says the issue is with either LoadSubImage or SetSpriteAnimation not liking non power of 2 atlases.

2048 x 2048 << loads fine
2048 x 1024 << loads fine
2048 x 512 << loads fine

1880 x 304 << fails on a single image

I can safely say with confidence that it is not my code, changing the settings in Texture Packer and changing nothing in the code differs the result.

Open Source plugins
Cl - DnD Plugin
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Aug 2021 17:51 Edited at: 19th Aug 2021 18:07
Most video cards require a power of 2 image size.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 19th Aug 2021 18:07
Ah, that probably explains it, I didn't think of that.
Open Source plugins
Cl - DnD Plugin

Login to post a reply

Server time is: 2024-04-25 01:07:07
Your offset time is: 2024-04-25 01:07:07