Hello,
I tried looking up the SetBorder function for a Sliced Sprite because it popped up while I was coding but didn't see it in the scripting manual.
I found the code that does it:
public void SetBorder(float left, float bottom, float right, float top) {
if (borderLeft != left || borderBottom != bottom || borderRight != right || borderTop != top) {
borderLeft = left;
borderBottom = bottom;
borderRight = right;
borderTop = top;
UpdateVertices();
}
}
Now my problem is that I'm trying to set the borders to 5, 5, 5, 32 (left, bottom, right, top respectively).
Instead it gives me this during 'Play': L = 580, B = 580, R = 580, T = 3712.
Am I missing something? I'm not sure why the numbers are so inflated.
Thanks!
*** EDIT UPDATE ***
I'm not sure if it's a feature or a bug or both
(I solved my issue for now):
My sprite is 116x116 in pixel size.
The border would multiply the value you give in SetBorder() to those pixel values.
I tried it with values of 10f and 1f. It would give me 1160 and 116 respectively.