Resets the width, height and slices for this NineSlice Game Object.
This allows you to modify the texture being used by this object and then reset the slice configuration, to avoid having to destroy this Game Object in order to use it for a different game element.
Please note that you cannot change a 9-slice to a 3-slice or vice versa.
name | type | arguments | Default | description |
---|---|---|---|---|
width | number | <optional> | 256 |
The width of the Nine Slice Game Object. You can adjust the width post-creation. |
height | number | <optional> | 256 |
The height of the Nine Slice Game Object. If this is a 3 slice object the height will be fixed to the height of the texture and cannot be changed. |
leftWidth | number | <optional> | 10 |
The size of the left vertical column (A). |
rightWidth | number | <optional> | 10 |
The size of the right vertical column (B). |
topHeight | number | <optional> | 0 |
The size of the top horiztonal row (C). Set to zero or undefined to create a 3 slice object. |
bottomHeight | number | <optional> | 0 |
The size of the bottom horiztonal row (D). Set to zero or undefined to create a 3 slice object. |
This Game Object instance.