Hello Guest

Author Topic: Cloned Sprite Issue (2.3.3)  (Read 3162 times)

LilBitStudio

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 11
    • View Profile
Cloned Sprite Issue (2.3.3)
« on: January 06, 2014, 06:16:30 pm »
When creating a cloned sprite with custom meshes, it appears that sprite atlasing and mesh generation doesn't compensate for clones.

It appears the first sprite's bounding box is used for sprite atlasing only ... causing cloned sprites to be clipped that fall outside of the first sprites bounding box (or adjacent atlas content to bleed into it).

Below is a simple example illustrating the problem. We do this in cases where we need to force the atlas to pack irregular shapes tighter as well as layer alpha and non-alpha meshes of the same sprite for performance.

Thanks - Scott

Example:

Sprite / Cloned Sprite
https://www.dropbox.com/s/8qoupecw4524lh0/Screenshot%202014-01-06%2013.13.46.JPG
https://www.dropbox.com/s/z13f21e3s1txpnp/Screenshot%202014-01-06%2013.14.07.JPG

Result in Atlas
https://www.dropbox.com/s/8oqdl7lh758mlkz/Screenshot%202014-01-06%2013.14.38.JPG

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Cloned Sprite Issue (2.3.3)
« Reply #1 on: January 07, 2014, 11:08:59 am »
Irregular shape packing isn't supported at the moment, and isn't in the roadmap either. However, you can manage this yourself by packing the texture the way you want, then disabling trimming in tk2d. The duplicates should be identified as such and only one copy of the texture will be in the atlas.

LilBitStudio

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Cloned Sprite Issue (2.3.3)
« Reply #2 on: January 07, 2014, 04:03:00 pm »
Perfect, thanks.

Disabling trimming on the sprites (and its clones) fixes the problem.

We're fine without the irregular packing (we can do that as needed), just that the trimming doesn't compensate for the custom meshes across clones. Thanks again - Scott