

Within this index.html file, include the following code: On your computer, create a new directory with an index.html file in it. So what do we have to do to accomplish this effect? Create a Phaser 3.x Project with HTML and JavaScriptīefore we look at creating, using, and animating a spritesheet, let’s focus on getting started with some boilerplate Phaser 3.x code. These are both animations with several frames within the same spritesheet. We also have a crude looking explosion that triggers after a certain amount of time. We have a crude looking plane that looks like it is flying, hence the jet-stream behind it. We have two things happening in the above image. To get a better idea of what we hope to accomplish in this tutorial, take a look at the following animated image:
TEXTUREPACKER ANIMATION HOW TO
In this tutorial, we’re going to see how to animate 2D sprites in a Phaser 3.x game using simple spritesheets with JavaScript. Loading one image file is less resource intensive than loading several image files, and when it comes to smooth performance in games, how you manage your resources can make or break your game. One of the main benefits to spritesheets, beyond them being easy to animate in modern game development frameworks, is they are easy on the computing resources. You could develop complex logic that swaps images on a sprite every time the render function updates, or you could work from a single spritesheet and iterate over the frames in that spritesheet. There are a few ways to accomplish animations in game development. They are going to want vibrant animations that add a certain realism to the game-play experience, even with it being 2D. No one wants to play a game with a static unappealing image that moves around on the screen. I guess the biggest thing for me that the Unity packer doesn't do is output modifiable Mesh assets.Ĭheers, let me know if you want some more input on the current sprite systems.When it comes to 2D game development, sprite animations are going to be a critical part of the game experience. Unity is now and will likely always be not as fine-grained as that because that's not really the goal heh I've walked that line with Unity team before going as far as assisting in improving features via beta list and private work with the mobile team. This method is great for all sorts of things - but most of all it gives a good gateway into custom-coding whatever you need. In my case, I added a "Attach Shadow Mesh" option which prepends (draw-order safe) and rotates the sprite mesh 90 degrees and vertex color's it so it loses all color information and turns half opaque. It is very easy to tightly integrate TexturePacker's CLI mode to batch process hundreds of existing project files and prepare them for Unity-ization.Īdditionally, it is easy to append features to this importer than Unity Sprites simply cannot accomplish.
TEXTUREPACKER ANIMATION PRO
Hopefully Unit圓D's built in texture packer will offer similar results for Unity Indie eventually, but even for pro features it offers no support for existing sprite sheets being imported without a great deal of labor.

I wrote the original source for this package because I had a massive number of Cocos2D projects and other already-prepped assets show up with sprite sheets that needed converting into Unity (Unity 2.x so iOS 1.5 and Unity 3 eventually). I put it all inside another "Editor" Folder and all is good.Īlso I downloaded the current github repository but I frankly do not know how to make an unitypackage out of that? Are you missing a using directive or an assembly reference?Įdit: ok, figured it out. Are you missing a using directive or an assembly reference?Īssets/TexturePacker/Plugins/TexturePacker.cs(162,24): error CS0246: The type or namespace name `SpriteMetaData' could not be found. Are you missing a using directive or an assembly reference?Īssets/TexturePacker/Plugins/TexturePacker.cs(217,28): error CS0246: The type or namespace name `SpriteMetaData' could not be found.

I'm using the script from post#1, its working fine in editor but I'm getting errors on build:Īssets/TexturePacker/Plugins/TexturePacker.cs(15,7): error CS0246: The type or namespace name `UnityEditor' could not be found.
