EDIT(15-09-2013): This project is closed and will not receive any new updates. Check the Bitbucket repository for the latest changes.
What is tlk2D? tlk2D is a free 2D framework for Unity 3D, written in C#. It provides an easy way to add 2D images and animations to your game. Tested only on Windows/MAC/Linux and Web-Player.tlk2Drequires Unity 4.
Features:
Atlas Builder
Sprite Animator
Collider Editor(experimental)
Runtime Sprite classes
Sliced sprites for 9-slice scaling.
Static Sprite Batcher
Custom anchor points
Pixel perfect rendering
NEW: Text Sprites
You can try a demo here.The demo uses iTween, created byBob Berkebile**.**
Documentation
The documentation for tlk2D is available online, here.
The framework is compatible only with Unity 4.x because I use custom namespaces. If you want to use it with 3.x just edit the scripts and remove the namespace(send me a PM if you need help). I will consider making it compatible with Unity 3.x when i release a new version.
My previous answer regarding Unity 3.5 was partially wrong. I’ve been using some new methods introduced in Unity 4 API so even if you removed the namespace you would still get some errors. I fixed those problems and uploaded a new package for Unity 3.5(I tested it only on Unity 3.5.7, the last version).
You can find the link in the first post, and let me know if you have any problems with it.
simone007, sliced sprites and text sprites will be added in the next release.
Collider Editor(experimental) - allows you to create custom mesh colliders for your sprites.
Static Sprite Batcher - gives you more control over the batching process.
Sliced sprites for 9-slice scaling.
A new container that can import sprite atlases exported in the Json format.
Improved features
The Atlas Builder has been rewritten and can show you in real-time how the sprites are packed. It can also export in the following formats:
tlk2D
Cocos2D
Json
The Sprite Animator has been improved.
All runtime sprite classes have been redesigned and rewritten.
Version 1.1
The pixel perfect rendering code has been improved, it now works with both orthographic and perspective cameras.
The AnimatedSprite class has a new option called “Animate Physics” that updates the center and size of the collider when the frame changes. It works only with the BoxCollider component.
First of all want to thanks daemon3000 for the great work!
Also have some questions: is this possible to handle sprite touch with this framework?
I’ve tried to use raycasting, but it doen’t work thou sprite doesn’t have mesh collider… or something like that.
Does anyone have any ideas?
The framework doesn’t have any built-in functionality for handling mouse or touch input, however, you could use Camera.ScreenToWorldPoint to get the mouse/touch position in world space and see if the sprite contains that position. To check if the sprite contains a position, you need to create a Rect from the position and size of the sprite and make a call to the Contains method.
This is a basic solution and it doesn’t work well if you have multiple sprite layers. In that situation you will need a manager script that controls the order in which sprites handle input.
A new version of the framework is available. It adds text sprites and containers to load bitmap fonts created with AngleCode’s BMFont utility(only Xml and text formats).
Found your tool gave it a try and like it good work very easy to use.
1 suggestion; on the sprite I found it handy to be able to turn off the update rotate function. My use case is that I am actually using this to build out a 3D GUI (see attached screen); The panels you see are made with slice sprites so the border doesn’t stretch all funky.
It was easy enough to update the script with a bool faceCamera and added a test for that on the update rotate function so I’m good for my uses but I think this could be handy for others.