Free 2D framework for Unity

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. tlk2D requires 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 by Bob Berkebile**.**

Documentation
The documentation for tlk2D is available online, here.

Download
You can download tlk2D from here.

Support
Feel free to send me a message if you have any problems with the framework or leave a reply here, I will check the thread regularly.

Screenshots

Videos
Videos showing the basic workflow using tlk2D.

Part 1

Part 2

Part 3

Part 4

Some of the new features:

  • Pixel perfect rendering
  • User defined custom anchor points
  • The Atlas Builder can now trim transparent pixels

A list with all new features, as well as bug fixes, is included in the package.

As the subject says, Unity 3.X support planned?

Thanks.

Btw,

Looks great.

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.

Thanks for the feedback.

Ahh. Thank you for the quick reply :slight_smile:

I’ll check it out. I’ll try removing the namespaces and see what that entails and try and report back in.

Thanks for making this package available freely.

Great work… sliced sprites? they are so important for me :smile:

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.

Many thanks D :slight_smile:

I was just about to start porting it. Very happy to see it’s been done.

I’m using 3.5.7 so I assume it should work fine. Will report back.

Example scene works great.

Thanks again.

Exellent work pal ive tested it a bit and im using it in a little project i have and works great

Version 1.1 has been released

Change Log:

  • Version 1.0

  • New Features

  • 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.

Thanks!

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.

Example:

PS: I’ll be using the slice sprite for the buttons you see top and bottom as well but in that case of course I want them to update rotate.