kaplay icon indicating copy to clipboard operation
kaplay copied to clipboard

bug: Buggy sprite look when slicing

Open amyspark-ng opened this issue 9 months ago • 9 comments

Using version ^3001.0.10 and loading this spritesheet:

Image

With this configuration

loadSprite("tv", "sprites/hit/tv.png", { sliceX: 8, sliceY: 1 });

I had this really bugged look

Image

Image

This happened when setting any frame above 4 i think, when setting 0 to 3 it was working fine

If this can't be reproduced in v4000 or any version for that matter then it must be something i was doing wrong then

"hmmm, so the uv coord calculation fails in some cases?"

amyspark-ng avatar Mar 26 '25 05:03 amyspark-ng

probably cause it is too wide, I think the max texture width is 1024 pixels but this image is over 3000 pixels wide

dragoncoder047 avatar Mar 26 '25 18:03 dragoncoder047

Ah that'd make sense, at first i thought it could be because the sprite is sliced in too many parts

So should i close as not planned since the limit is 1024? Maybe it should throw and Error or warning when a sprite is too big instead of just letting it slide

amyspark-ng avatar Mar 26 '25 18:03 amyspark-ng

I don't know why, but the same is happening with me, even though i export the image as 640px x 480px in illustrator 🤷‍♀️

Image

Image

htferretti avatar May 21 '25 16:05 htferretti

the raw image is 2000x2000, so it might be that, tho im pretty sure kaplay can load up to 2048x2048, maybe slicing for animations on big sprites is bugged

amyspark-ng avatar May 21 '25 19:05 amyspark-ng

i exported the image as an asset export in illustrator, and now it works! 😁 thank u

htferretti avatar May 21 '25 21:05 htferretti

how did you fix it exactly? just exported as sepparate sprites or?

amyspark-ng avatar May 22 '25 03:05 amyspark-ng

well, i imported the 2 images on illustrator, in a document 640 x 480, placed them by side, and instead of exporting as a normal png, there is an option on File > Export > Export selection (asset export). i dont know what it means or why it worked thoug 🤷‍♀️ xdd. if you want to, get my discord: htferretti#4777 , idk why github doesnt have dm

htferretti avatar May 22 '25 20:05 htferretti

I had this issue with a background image : 3282x1846 Using the option singular solved the issue for me :

loadSprite("level3BG", "sprites/antwerpen.png", {singular: true});

tperraut avatar Jun 22 '25 09:06 tperraut

A spritesheet is 2048 wide, so this would never fit in a spritesheet.

mflerackers avatar Jun 22 '25 23:06 mflerackers