Hello Guest

Author Topic: 2D Toolkit 1.91 final  (Read 16134 times)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
2D Toolkit 1.91 final
« on: February 25, 2013, 02:51:52 pm »
As with all releases, exercise caution when upgrading.
Make sure you have a back up!

Features:
- 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.
- tk2dSpriteCollectionData.GetSpriteDefinition returns a sprite definition.

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.


TekuStudios

  • 2D Toolkit
  • Full Member
  • *
  • Posts: 177
    • View Profile
    • Teku Studios
Re: 2D Toolkit 1.91 final
« Reply #1 on: March 05, 2013, 10:57:23 am »
Hi! This last update works perfect!

Just a quick question (I can't find it anwhere), how do I play an animation reversed from script? Something like CurrentClip.Reverse or so? Thx.
We are an Indie videogame developer located in Teruel, Spain. A small 6-people team which is currently working on the upcoming 'Candle'.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.91 final
« Reply #2 on: March 07, 2013, 06:31:32 pm »
There isn't at the moment, but you can create a reversed clip in 2 clicks - Create > Copy, then Reverse. Also, with the animation editor plugin system, you can automate creating reversed versions of all clips.

TekuStudios

  • 2D Toolkit
  • Full Member
  • *
  • Posts: 177
    • View Profile
    • Teku Studios
Re: 2D Toolkit 1.91 final
« Reply #3 on: March 08, 2013, 09:19:39 am »
Yeah, I already noticed that, thank you for your answer.
We are an Indie videogame developer located in Teruel, Spain. A small 6-people team which is currently working on the upcoming 'Candle'.

CoderBear

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: 2D Toolkit 1.91 final
« Reply #4 on: March 16, 2013, 10:35:08 pm »
Why when I attach the 2dTKCamera it leaves the scene in an unsaved state.  I noticed this post was also made on the release for 1.92b2 as well just thought I let you know it is also with this version as well.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.91 final
« Reply #5 on: March 17, 2013, 12:04:38 am »
@CoderBear - I've addressed it in the next version, but it isn't 100% foolproof. If the resolution changes, then the data gets invalidated. But it doesn't constantly change it as it does right now.

bitbutter

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: 2D Toolkit 1.91 final
« Reply #6 on: July 22, 2013, 06:35:33 pm »
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.

Could I get a description of what viewport clipping is, when/why you might want to use it (and why two cameras are necessary). Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.91 final
« Reply #7 on: July 22, 2013, 09:54:59 pm »
Viewport clipping lets you clip a camera to a section of the screen. You might want to do this for various reasons, off the top of my head, split screen. It needs a second camera to store all the override information, otherwise having 2 completely different setups could be pretty meaningless, especially if you want to show a region of the original scene.