![]() Enter the encryption key in TexturePacker and copy 2 files to Cocos2D folder, add 4 lines of code.Our app will be able to decrypt the data. It’s called content protection and simply encrypts the images. This feature helps to protect the assets from theft. The effect of compression or dithering is nearly invisible on high-resolution devices.Compress your sprite sheet and drastically reduce memory usage.Reduce memory consumption, not image quality Here are few great features of TexturePackerġ. ![]() In short: let’s you choose when & how to load these sprite atlases.TexturePacker is a great tool that makes it incredibly easy to generate these sprite sheets with the click of a button which saves a lot of time. And yet, you need to load them on certain user interactions.īad news: just referencing them for later (“just in case”) will actually load them immediately in memory, causing the evil final boss Ralf to fire you.īut you can keep your paycheck: we can use Addressables to load/unload your sprites on sprite atlases on demand, no matter the references you have. ![]() Here’s the truth: you can’t pay the price of having all these sprite atlases loaded in memory at the same time. Imagine you have a complex UI system with TONS of sprites and sprite atlases… a game like The Sims with 4000+ expansions and millions of different item preview sprites. That means, you want to pack together the sprites that you use at the same time.īut even if you pack your sprites perfectly, you might still run into trouble.įor instance, you might load the entire sprite atlas too early… when you cannot really afford to. The first thing you will want to do in Unity when dealing with sprite atlases is to engineer your sprite atlases in a way that it maximizes the economy of your sprites. Packing and referencing your sprites unoptimally can have nasty side effects, such as crashes and increased loading times. When you reference a sprite that lives within a SpriteAtlas, you load the entire atlas into memory and then use the specific region your sprite takes. The Problem: Unity SpriteAtlas’ Default Behavior ![]() Shaking badly anth fever symptoms, you boot up your PC and wait 10 minutes for Unity to load your project.Įager, you get to the score screen and BAM. But get your ass down here and fix the crash that happens in the score screen”, Ralf says just before disconnecting. “W…ait what.?” You barely manage to ask as an eerie chill runs down your spine and cold sweat pours down your forehead. Hearing these words stuns you for very long 5 seconds, losing a stamina point in the process. “Wh… Who is it?”, you ask, your voice trembling. However, just as you’re about to sleep, your phone rings… loudly. * My italian girlfriend doesn’t approve of this. It was a great day… and you reward yourself with a pineapple pizza*. So you hit the submit button and call it a day. Just like you expected, you manage to reduce: So you read some documentation and decide your next step: you’re going to put your heavy sprites in a single SpriteAtlas. You’re so happy that you start singing a made-up song about how today you are going to improve the architecture of your game. You wake up and, for some reason, you feel extremely happy.
0 Comments
Leave a Reply. |