Hello Guest

Author Topic: 2D Toolkit 1.91 beta 2  (Read 8602 times)


  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
2D Toolkit 1.91 beta 2
« on: February 24, 2013, 12:46:33 am »
As with all beta releases, exercise caution when upgrading. Make sure you have a back up!

- Brand new sprite picker with preview and filtering, see attached screenshot.
- tk2dCamera supports "inherit settings". This will let you hook up a tk2dCamera prefab, set up the resolution overrides and such on it, and just inherit the settings onto a tk2dCamera in a scene. It is also useful in another scenario,
- tk2dCamera supports clipping. This is an early no-frills implementation, but it works. Notes below.
- tk2dCamera clipping supports resolution overrides.

Bugfixes and improvements:
- Sprite collection editor warns when sprites are missing, and won't allow builds with missing sprites to avoid damaging already built data.
- Fixed clear references in sprite collection editor
- Rebuilt built-in fonts, some were in an ancient format and had never been updated.
- Force texture size is now used properly with platform specific collections
- sprite.collection made private, this was an internal variable which was accidentally left public. Use .Collection instead if you need to read the value, and prefer new SetSprite APIs for setting a new sprite.
- sprite.SetSprite, a unified way to set sprites. SetSprite( spriteId), SetSprite( spriteName ), SetSprite( collection, spriteId), SetSprite( collection, spriteName)
- tk2dGrid, started using in some places
- tidied up preferences system (all current preferences will be lost)
- setting platform in preferences fixed (was broken in 1.91 beta 1)
- stopped breaking spectacularly when there is a broken animation.
- bundled clipping demo (#12), now fully works, resolution overrides are fully supported. Webplayer here: http://unikronsoftware.com/2dtoolkit/webplayer/clippingdemo/
- sprite thumbnails tidied up, always displays as a 128x128 tile in the inspector, sprite itself centered in the tile.
- lots more user friendly functions (tk2dSprite.AddComponent(go, spriteColection, spriteName)) to avoid having to get spriteId.
- upgraded all legacy demo assets
- tk2dTextMesh.FormatString( unformattedSring ) returns formatted string.

tk2dCamera clipping notes

- Tk2dCamera now supports viewport clipping. This is only allowed on a second camera, so don't forget to set the "Depth" parameter to something greater than your primary camera, and set clear flags to "Depth only" or "Dont clear" depending on what you want. Also, use layers to mask information from one scene to another.
- The cost of the clipping is close to zero (especially so if you don't clear on the second camera), and you can clip anything. As a downside, you can't rotate the clip region, it must be rectangular and in screen space.
- You can clip anything. Including 3d objects, without messing about with shaders, and at close to zero cost. Check webplayer above.
- If you have 2 tk2dCameras in the scene, you can (and probably should) use "Inherit settings" so you won't have to set up the overrides twice and make sure they're the same.
- The clipping behaves very differently to the built in Unity camera "viewport rect", and has different terminology (region instead of rect).
- The region is like a clip region, it reveals part of the background. Set up the region to 0, 0, 100, 100, and then slide the X value. This will let you really easily set up a level selector visually. Just set it up as though you're drawing everything and set up the the viewport clipping region on the second camera. Tip: set clear color in the 2nd camera to something bright so you can see the region you are revealing.
- You can anchor within clipped regions
- More features will be coming, like anchoring the clip region dimensions, but not in 1.91. The clip region is parent camera space, should be easy to modify externally.
« Last Edit: February 24, 2013, 12:49:55 am by unikron »