Skip to content

NineSliceSprite

Creates a NineSliceSprite

Allows you to stretch a texture using 9-slice scaling. The corners remain unscaled (useful for buttons with rounded corners, for example) and the other areas scale horizontally and/or vertically.

API

NineSliceSprite Attributes

NameTypeDefaultDescription
texturestring objectundefinedThe texture to use on the NineSliceSprite.
left-widthnumberundefinedThe width of the left column
right-widthnumberundefinedThe width of the right column
top-heightnumberundefinedThe height of the top row
bottom-heightnumberundefinedThe height of the bottom row

more props in Container Attributes and PixiJS NineSliceSprite

NineSliceSprite Events

NameTypeDescription
effectfunctionCustom effect function called each frame

more events in Container Events