![]() You might have to adjust the offset calculation depending on the pivot point / origin in your graphics system. Screen.draw(sheetImage, posX+offsetX, posY+offsetY, width, height) SpriteSourceSize gives you the offset for drawing the image - the parts of the image that are left out because of the trimming:Ī simple pseudo-code drawing routine looks like this: drawImage(spritename, posX, posX) The frame gives you the location of the original sprite in the sprite sheet. The important parts are frame and spriteSourceSize. The result is that you now get 2 files: The sprite sheet and a JSON description file. Pixel format: INDEXED 8bit - to create 8bit PNGs (about 70% less memory).TrimMode: Trim (this creates rectangles).Data format: JSON hash (or XML if you prefer that).Now drag the images on TexturePacker and select the following parameters ![]() You need this for aligning the animation. This is why there is so mich empty space above. Keep the original position of the bird in the images. You should split static and moving parts: I've placed a bird on a house to demonstrate this:īasically packing the complete animation into a sheet is a big waste of memory. In the original image, only one part of the image was moving. As promised won't make them public here so I've created some art myself to demonstrate how to reduce the memory usage.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |