I had a look at atlas textures in TexturePacker. There are less options for sparow format than corona or cocos2D. Triming cannot be applied , so animations must use sprites with large bounds that can contains each frame. It wastes space in the atlas , but what is more anoying, is that larger frames uses more memory.
I beg you Daniel , please make triming part of 1.1 new features ! I promise I'll never ask for other new features. I'll even break up with my wife and marry you
Texture atlas triming
(14 posts) (6 voices)-
Posted 1 year ago #
-
Daniel If you want, i will marry you too !
Posted 1 year ago # -
LOL!!!
I can't promise anything yet, but I will definitely have a look at this for the next update -- despite those scary threats
Posted 1 year ago # -
thumbs up for that joke duss!
Cheers Arend
Posted 1 year ago # -
Yes that would be inf*ckingcredible!
I'm currently working on a project with some heavy animations, and that would help us save a LOT of precious memory!greetings,
starenchanterPosted 1 year ago # -
Hi, was anything done about this? I think not because the engine seems to be ignoring the frameX, frameY, frameWidth and frameHeight attributes. Can you confirm or deny please?
Posted 7 months ago # -
I think I've found the issue. It's not automatically. I have to keep readjusting the position of my SPImage according to SPTexture.frame.
Posted 7 months ago # -
Hi Matt,
what do you mean exactly? The frame property of the texture should be exactly what you're looking for: it is used by the image class to move the image to the position where it would be if the texture had not been not cropped.
E.g. you have a texture that is 50x50 pixel, and the top left part is cropped, so that only the parts right and below (20,30) remain.
Than the frame property would be:
frameX -20
frameY -30
frameWidth: 50
frameHeight: 50It's the coordinates of the image frame, measured from the root of the texture. Look at your cropped texture, start in the origin (top left), and move 20 pixels to the left (-20 in x direction), and 30 upwards (-30 in y direction), and you're at the root of the image (= the uncropped texture). Then go 50 to the right and down to have the complete size of the uncropped texture.
Does that help?
Posted 7 months ago # -
Yes I found out how to use it. For some reason I assumed that it would be automatic and I didn't have to manually adjust the SPImage according to the SPTexture frame property. I discovered that this was an incorrect assumption.
Thanks for the reply!
Posted 7 months ago # -
Hm, you shouldn't have to do it manually! When the frame property is set correctly, an image with the texture should behave just as if the texture never had been cropped in the first place!
If you're using TexturePacker to create an atlas for a movie clip, you should be able to use an atlas with trimmed textures and an atlas with untrimmed textures. The result should be the same, without changing any code!
Posted 7 months ago # -
Did you get it to work, Matt?
Posted 7 months ago # -
No I abandoned it due to time constraints and used a packed texture with no trimming.
Sorry!
Posted 7 months ago # -
No problem! If you find the time to have another look at it, just post it in this thread. But it's no problem if you leave it that way.
Posted 7 months ago #
Reply
You must log in to post.