Hello Guest

Author Topic: Sliced Button Sprites  (Read 4829 times)

larryapple

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
Sliced Button Sprites
« on: June 20, 2013, 06:17:22 pm »
I'm really liking tk2dUI, and am making a nice set of panels based on your 2-page example. But how do I replace the button graphics with my own images, using sliced sprites so I don't have to decide on the exact size ahead of time?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sliced Button Sprites
« Reply #1 on: June 20, 2013, 06:36:54 pm »
The button graphics ARE sliced sprites. Just select the sprite you want from the sprite collection editor to swap to your own graphics.

larryapple

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Sliced Button Sprites
« Reply #2 on: June 20, 2013, 07:19:59 pm »
But you aren't telling me how to do it. For example, I create a collection and put a 75 x 75 pixel gear icon into it. Then I go to my hierarchy where I had duplicated a basic button from your examples, select the button graphic and instead choose my sprite, which is not sliced. The normal sized button now changes to an image almost as large as the entire screen. So now I am completely confused.

So now I read your response again, and go to your example collection, where I can change the image. So this means I should modify your examples, instead of making new assets? Then I will want quite a few of these. So what workflow do you suggest?
« Last Edit: June 20, 2013, 07:32:58 pm by larryapple »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sliced Button Sprites
« Reply #3 on: June 20, 2013, 09:31:10 pm »
Make sure your sprite collection is created with the same settings as the UI sample sprite collection (specifically, ortho size = 1, tk2dCamera = off) - if it is, then you can simply replace the sprites as you've done now, and the sprites will be the same sizes. That should be it.

In terms of workflow, the easiest / best thing to do is to drag the prefabs into the scene as described in the tutorial, and customize them the way you need them for your game, and then create prefabs from these to use in your own project.