Making resizable buttons?

Hey everyone, does anyone know where I can find tutorials on resizable buttons? You know what I’m talking about right? I was wondering if it was possible to make my own custom buttons the way the Unity button system does where you have a simple square image that can resized, stretched about and so on because then it would make adjusting my UI much easier.

So far I’ve only been able to import sprites the normal way and even though I get the buttons function fine I’d like to be able to change them up properly without having to constnatly making adjustments in photoshop.

Nevermind! Just worked it out, classic case of posting then working it out by experimenting, what I did to get it right was make just a normal square button just like the standard unity button and after that it all started resizing fine, just need to tweak things now, YAY!

Optionally you could also design the button in Photoshop so that you can 9-slice it. When you import the object into Unity and set the image on the button you can select Sliced as the type and free scale it however you like. Note that you would have to set up the 9-slice parameters in the Inspector after import as well.

Thanks for that tip, by the way, I’ve been having some scaling issues with a slightly more complicated buttons though it’s really just a sprite issue, they’re high resolution but I don’t have any way of scaling them up image wise while keeping their overall shape the same.

Is that even possible? What I’ve got are some stars that smile when you click them but the sprites are too small to see them clearly when they fit into the camera screen, I’ve been wondering if I need to adjust the camera itself and the canvas, but then the other buttons end up going out of focus because they get massive.

Hmmm, a bit hard to say without knowing a few things.

  • What are you using for UI? World Space, Screen Space or Camera Space?
  • How big is the source asset for this star?