Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Cheruby

Pages: [1]
1
Support / Setting the borders of a Sliced Sprite
« on: June 04, 2014, 03:38:24 pm »
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:
Code: [Select]
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.

Pages: [1]