Hello Guest

Author Topic: Changing the background color of the sprite collection editor?  (Read 3476 times)

jpkrinoid

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
I've been using the custom render shape option in the sprite collection editor which is working great, but I've ran into one issue:  some of the sprites I'm trying to make a custom shape for are the same exact color as the sprite collection editor background!  I'm using a the solid tk2d shader, so if the render shape isn't exact it leaves a lot of black around the sprite.  I've managed to get most of them close, but its a lot of guessing and checking.

I've dug through the editor scripts, and can't really find where you are setting this color (if its something you are even setting at all....).  It would be really helpful if I could figure out where this is happening so I could change the color in the editor to black or red, and better see where the lines of the sprite are.  Any ideas?

Thanks for your great work on 2d toolkit, every day I find out more features / optimizations I can do with it, its amazing.  Keep up the good work!


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Changing the background color of the sprite collection editor?
« Reply #1 on: March 17, 2013, 10:21:57 pm »
If you update to 1.92 beta (or selectively update) - the behaviour is changed in this version. It now draws a "grid" there, and the grid color is customizeable like all other grids in the toolkit. That might solve the problem entirely for you.

Alternatively, if you wanna hack something into the current version...
tk2dSpriteCollectionEditorTextureView
Look for GUI.DrawTexture,
above it a bit there will be Rect rect = GUILayoutUility.GetRect(....);

All you need to do is draw something into that rect.
You can add this one line right after that:
tk2dGrid.Draw(rect);

to draw the grid.

jpkrinoid

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Changing the background color of the sprite collection editor?
« Reply #2 on: March 17, 2013, 10:57:43 pm »
Went ahead and updated to the 1.92 beta...definitely helped in this case!  Thanks for the quick response!