2D Toolkit Forum

2D Toolkit => Support => Topic started by: nikolay1243 on February 14, 2018, 02:49:04 pm

Title: How can I reduce the size of the white border to only contain the green border?
Post by: nikolay1243 on February 14, 2018, 02:49:04 pm
(https://clip2net.com/clip/m560450/909ab-clip-13kb.png)

Hi, so I have a bunch of building sprites that share the same image dimensions
However since they all overlap, most of the time I'm clicking on the empty space outside the green border in the image which is super annoying...
Is there a way to fix this?
Title: Re: How can I reduce the size of the white border to only contain the green border?
Post by: unikronsoftware on March 05, 2018, 11:53:48 am
Hi,

One option is to disable the sprite controls - (preferences, enable sprite controls). The handles are controlled by that.

If you want them enabled, but want it to be the tighter bounds, tk2dsprite.cs, line 249 or so
   void OnDrawGizmos() {
         Gizmos.DrawCube(Vector3.Scale(sprite.untrimmedBoundsData[0], _scale), Vector3.Scale(sprite.untrimmedBoundsData[1], _scale));

Rename untrimmedBoundsData to boundsData