As well, I made sure there were no odd sized sprites. I have tried running TP separately for HD and SD images but it didn’t work. I haven’t tried other sorting algorithms, since I’m using the non pro version. TexturePacker -data a -format corona-imagesheet -allow-free-size -shape-padding 2 -border-padding 2 -sheet animation.png -no-trim -algorithm Basic -scale 0.5 *.png TexturePacker -data a -format corona-imagesheet -allow-free-size -shape-padding 4 -border-padding 4 -sheet animation-hd.png -no-trim -algorithm Basic *.png TexturePacker -data a -format corona-imagesheet -allow-free-size -shape-padding 4 -border-padding 4 -sheet animation-hd.png -no-trim -algorithm Basic -auto-sd *.png These sets of commands created proper imagesheets for SD and HD: I ran a test on the latest texture packer beta 8: 100 sprites. For scales 1.0, 1.8 and 4.0 you will need your high res images to be divisible by 20! This is so that when you set the scale to 0.75 for your 1.5 resolution images there will still be a whole number of pixels for TexturePacker to work with. For example if you are going to use 1.0, 1.5 and 2.0 you must make sure the high res images are divisible by 4. It gets more complicated if you are producing assets for more resolutions. lua file in Corona that was generated for the 1.0 scale images. I export these images and then change the scale to 0.5 and change padding to 2 then export my 1.0 scale images. When using TexturePacker I use an imagesheet that is 2048x2048 and set padding to 4. if I am using scales 1.0 and 2.0 then I just need to make sure that the width/height of my 2.0 images are all even (divisible by 2). You can even hand off the sprite sheet creation to your artist. It extracts animation frames and stacks side by side or one under. The way I make this work is to ensure that all my images at the highest resolution I am going to use are divisible by the other scales I want to use e.g. The free TexturePacker Importer plugin for Unity automatically re-imports the data as soon as you re-enter Unitys editor. Upload animated image (GIF, APNG, WebP) and this tool will convert it to PNG sprite sheet. If they are not then you will find that TexturePacker (rightly so) may move the images around when you change the scale. Im installing texturepacker in cipostclone.sh script using below command in Xcode Cloud workflow. You should work with the highest resolution first but must make sure that the images are divisible by the other scales you want to use. The other problem that you will find is when you are creating multiple resolutions. I think some kind of trimming divisor will be needed in TexturePacker to fully support this feature, but seeing as the API is not yet in a Corona stable release I doubt that Andreas will want to commit to adding the functionality If this results in odd pixels (or more accurately pixels that are not divisible by the scale you want to produce) then the images will jump around slightly due to different offsets.įor now I am not using trimming as I need to use dynamic image scaling. As Andreas mentioned TexturePacker will always try and pack the images as best as possible. The main problem you will have is with dynamic image scaling. I have used the API and it is stable enough. Launch TexturePacker and you should now have a corona-trim-imagesheet option.Change the supportsTrimming element to “true”.Change the template element to reference the new.Change the name element to reference the new name “corona-trim-imagesheet”.Open the exporter.xml file in the new folder.Open a and replace the frames section with the code I posted previously.Rename the new folder something like corona-trim-imagesheet.Create a new exporter by opening the TexturePacker package then create a copy of the Corona Exporter folder under Resources/exporters/corona-imagesheet.The code that I posted previously adds these values to the exporter for conorna SDK in TexterPacker. You will see in uma.lua that trimming is used by setting the values for sourceX, sourceY, sourceWidth and sourceHeight for the imagesheet. I got the information about sprite trimming from the latest Corona SDK in the sample code HorseAnimation. you can't even determine how many frames are in the animation.I’ve spent a while getting all this to work - here goes no matter how they're ordered you can't determine frame 1, 2 etc. they need a data sheet that supplies that info.įor example, here's the spritesheet for a movieclip that consists of green circles. how can they determine where one sprite starts and stops and another begins?Īnswer: they can't if they just look at the spritesheet. now imagine showing that spritesheet to someone unfamiliar with your animation. Imagine the situation where each sprite consists of several non-contiguous identical shapes.
0 Comments
Leave a Reply. |