Search code examples
unity-game-engine2dphotoshopadobe-illustratorunity3d-2dtools

Dynamicly resizeable custom Buttons - how to make?


please I have bought GUI pack for 2D mobile games. I have vectors for buttons but I don't know how to make it "smaller" - dynamically resizable for Unity.

This is my bought button:enter image description here

And I need to make from it this (with all corners, etc.)

enter image description here

In Unity, I will resize it according to my needs and add text. But I don't know how to make it in Photoshop or Illustrator, how to smaller it with keep corners and make "middle" of button to be dynamic.


Solution

  • I think that you can use the "Image Type" property on your Sprite component.

    http://docs.unity3d.com/Manual/script-Image.html

    That option gives you the possibility of scaling the center of the image, keeping the size of the borders.

    In this video they explain the property (from 1:16 aprox)

    https://www.youtube.com/watch?v=WFQcc1GUe7U

    Cheers !