Hello Guest

Author Topic: 2D Toolkit 1.80 + patch 1  (Read 12003 times)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
2D Toolkit 1.80 + patch 1
« on: October 22, 2012, 02:43:03 pm »
Some bugfixes

Features and changelist. Changes in this update in italics.
Unity 3.5 and above only
Renamed collider types (ForceNone instead of None, UserDefined instead of Unset). Makes a lot more sense.
All mesh leaks plugged, hopefully.
Sprite collection settings page tidied up, added a lot more texture options.
Massive memory saving with large animations (there was a constant overhead, which is now fixed).
New tk2dSystem feature, manages platforms and resources.
Sprite collection can be made loadable - this uses the tk2dSystem resource loading feature, and doesn't need files moved to different locations. The sprite collection can also be loaded by GUID at runtime.
Sprite collections are sorted by name in inspector
Internal data upgrade, slowly moving away from legacy cruft (hopefully still backwards compatible). A message is printed out when sprite collections are upgraded.
Animated sprite bugfix, calling play from an event works.
Runtime sprite collection stuff integrated, use tk2dSprite.CreateFromTexture or tk2dSpriteCollectionData.CreateFromTexture
Switch platfroms in editor in the preferences page. Sprite collections and fonts which have platform data will switch when this is changed.
Sprite collections don't use mipmaps by default.
And loads more small fixes
Unity 4 fixes. Should now work properly with no warnings.
Auto build fixed, and also work for sprite collections with platform specific data. Only the affected sprite collection is rebuilt.
Formatted text implementation, now as it should be. This isn't 100% compatible with the previous version if text is entered in the interface, line breaks may be incorrect, but should be 100% compatible if updated using code.
Fonts in sprite collections try to pick up texture name from bmfont file
Font builder works correctly without requiring renamed textures - it automatically picks up the correct file from the bmfont
Materials are shared properly between sprite collections and fonts, batching should work as expected.
Platform data requirement code should be a lot more stable under weird conditions imposed by Unitys unpredictable script execution order
Fonts switch correctly when changing platform
Material overrides work, but need to be set up in the interface (i.e. new ones will work with platforms)
Fonts in sprite collections can be set up to use overriden materials
Support for gradients for fonts in sprite collection - needs a bit of manual set-up, but works
Rebuilding index will rebuild the tk2dSystem object - none of the resources should be checked in to version control
OrthoSize/texelSize set up properly for text meshes
Tilemaps work, but inefficient when switching platforms - it is vastly more efficient for now to switch platform in editor, load original scene and save scene as @2x, etc, and load the appropriate scene at runtime. Simply loading and saving in editor is sufficient.
Custom sprite geometry & custom colliders work properly.
Platforms are limited to 1x, 2x and 4x for now. More extensive customization will be available in the next release.
tk2dIndex.cs works better when upgrading from an old version
Animation editor bug, wasn't working correctly with sprite collections with platform data
Fixed tk2dSlicedSprite not working when in a prefab
tk2dBaseSprite.GetCurrentSpriteDef wasn't initializing the sprite collection instance correctly

« Last Edit: October 22, 2012, 02:58:13 pm by unikron »

wiley.a

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: 2D Toolkit 1.80 + patch 1
« Reply #1 on: November 02, 2012, 11:57:22 am »
A while ago I was on the forums asking about moving sprites and their references between collections and eventually I got it working with 1.76. However now that I have updated to this version I have had to alter my script to account for the depreciation of tk2dSpriteCollection.textureRefs. I have updated it to use tk2dSpriteCollection.textureParams but its not working correctly. What should I be using in place of tk2dSpriteCollection.textureRefs?

Thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.80 + patch 1
« Reply #2 on: November 02, 2012, 12:40:01 pm »
textureRefs is now folded into textureParam [ x ]
Check tk2dSpriteCollection.Upgrade
the part about version < 3 is the relevant bit here.

pdform

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
    • The Balance Inc
Re: 2D Toolkit 1.80 + patch 1
« Reply #3 on: November 06, 2012, 05:24:20 pm »
Hi, I had to implement by hand (and with unikron's support help) some patches to apply a global zoom (that only works from the bottom left corner) to tk2dCamera and also to change an animation framerate on runtime, without changing it also in editing time (if you change the fps field of the clip directly at runtime, it will change permantly in the project). I was wondering if there's any new way to deal with these issues in the new version...

CrowbarSka

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: 2D Toolkit 1.80 + patch 1
« Reply #4 on: November 07, 2012, 03:28:54 pm »
I'm getting a problem after upgrading to this version. None of my sprites are affected by fog; they appear fully un-fogged when other objects at the same distance (e.g. polygonal meshes) are fogged correctly.

My fog is Linear and my camera is Perspective. Not sure whether these matter or not, but it worked fine before upgrading 2D Toolkit. Perhaps the problem is something to do with the shaders?

I'm using Unity 3.5.6f4 (the latest version).


EDIT: I managed to fix this by changing Fog { Mode Off } to Fog { Mode Linear } in the shader. Was there any reason this got changed in the update? Will future updates continue to override my local changes?
« Last Edit: November 08, 2012, 12:13:36 am by CrowbarSka »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.80 + patch 1
« Reply #5 on: November 08, 2012, 10:09:01 am »
I'm getting a problem after upgrading to this version. None of my sprites are affected by fog; they appear fully un-fogged when other objects at the same distance (e.g. polygonal meshes) are fogged correctly.

My fog is Linear and my camera is Perspective. Not sure whether these matter or not, but it worked fine before upgrading 2D Toolkit. Perhaps the problem is something to do with the shaders?

I'm using Unity 3.5.6f4 (the latest version).


EDIT: I managed to fix this by changing Fog { Mode Off } to Fog { Mode Linear } in the shader. Was there any reason this got changed in the update? Will future updates continue to override my local changes?

Yes - its slower having fog on than not, which is why its off by default.
I suggest making a copy of the default shaders and using them instead so you wont have to repatch every time it gets updated.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 1.80 + patch 1
« Reply #6 on: November 08, 2012, 10:10:38 am »
Hi, I had to implement by hand (and with unikron's support help) some patches to apply a global zoom (that only works from the bottom left corner) to tk2dCamera and also to change an animation framerate on runtime, without changing it also in editing time (if you change the fps field of the clip directly at runtime, it will change permantly in the project). I was wondering if there's any new way to deal with these issues in the new version...

Both of those changes should merge fairly easily - nothing has changed significantly in those areas between the releases.