![]() If you want to use this rather than an atlas i suggest you fix your spritesheet so that you don't have any empty frames. Fred has another example called Textureatlas for texture atlas. The caveman example does not use a texture atlas, it just grabs equal frames from a spritesheet. The flicker is due to the extra empty frames that you have in your image. So I'm thinking the flicker at the end of my animation are these blank frames. Notice the border is longer than it needs to be. I've attached the png file that I use as input for the Atlas and a screenshot of what TexturePacker looks like when I add that pic. So I wonder if TExture Packer is forcing me to have 7 frames across because of the Max Page Width? ![]() So only 7 full frames would be able to fit across if I had 7. Each animation frame is 117 high by 143 wide. Now, looking at the max width for the page, it's set to 1024. And it LOOKS like there's space for 3 more sprite frames judging by the border displayed around my image in Texture Packer. It seems the TExture Packer adds extra space on the end of my 4 images as if it's trying to fill up the width of the page. So after trying to debug for a while, I decided to reduce the spritesheet to just 4 images and then pack it. When I log the Length property of my lgTexture array, B4A tells me that I have 7 elements instead of the 4 I expect. I was hoping that the resulting array of lgTextureRegion would have some kind of method to add more frames but it seems to only give the Length property.Ģ.)The second, bigger issue seems to be that when I run my animation (which only uses 4 frames because of the issue above), the animation seems to flicker at the end. ![]() But I wanted to use all of the frames and not just a single array of frames for the animation. But I use the GetRegionArray() function but it seems that it's designed to return a specific array (of a two-dimensional array) based on index. I modified it to be 16 frames with 4 columns and 4 rows. In short, I have two issues.ġ.) The spritesheet had 6 rows of sprite animations, 5 to a row. And I tried out the GDX Texyure Packer with a spritesheet IF found on line. Using the Caveman animation example I modified the code to pull my animation frames from the Atlas. I've got a small game in the works where I'm trying to have all images and animation sequences in a Texture Atlas. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |