Initializes a 9-slice sprite with a texture file, a delimitation zone and
with the specified cap insets.
Once the sprite is created, you can then call its "setContentSize:" method
to resize the sprite will all it's 9-slice goodness intact.
It respects the anchorPoint too.

Initializes a 9-slice sprite with an sprite frame and with the specified
cap insets.
Once the sprite is created, you can then call its "setContentSize:" method
to resize the sprite will all it's 9-slice goodness interact.
It respects the anchorPoint too.

Parameters:

spriteFrame

The sprite frame object.

capInsets

The values to use for the cap insets.

initWithSpriteFrameName(spriteFrameName, capInsets)

Initializes a 9-slice sprite with an sprite frame name and with the specified
cap insets.
Once the sprite is created, you can then call its "setContentSize:" method
to resize the sprite will all it's 9-slice goodness interact.
It respects the anchorPoint too.

Parameters:

spriteFrameName

The sprite frame name.

capInsets

The values to use for the cap insets.

{Boolean}isFlippedX()

Returns the flag which indicates whether the widget is flipped horizontally or not.

It only flips the texture of the widget, and not the texture of the widget's children.
Also, flipping the texture doesn't alter the anchorPoint.
If you want to flip the anchorPoint too, and/or to flip the children too use:
widget->setScaleX(sprite->getScaleX() * -1);

Since:

v3.3

Returns:

{Boolean} true if the widget is flipped horizontally, false otherwise.

{Boolean}isFlippedY()

Return the flag which indicates whether the widget is flipped vertically or not.

It only flips the texture of the widget, and not the texture of the widget's children.
Also, flipping the texture doesn't alter the anchorPoint.
If you want to flip the anchorPoint too, and/or to flip the children too use:
widget->setScaleY(widget->getScaleY() * -1);

Since:

v3.3

Returns:

{Boolean} true if the widget is flipped vertically, false otherwise.

isOpacityModifyRGB()

returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity);

Since:

v0.8

resizableSpriteWithCapInsets(capInsets)

Creates and returns a new sprite object with the specified cap insets.
You use this method to add cap insets to a sprite or to change the existing
cap insets of a sprite. In both cases, you get back a new image and the
original sprite remains untouched.

The untransformed size of the Scale9Sprite or The untransformed size's width of the Scale9Sprite.

{Number}heightOptional

The untransformed size's height of the Scale9Sprite.

setFlippedX(flippedX)

Sets whether the widget should be flipped horizontally or not.

Parameters:

flippedX

true if the widget should be flipped horizontally, false otherwise.

Since:

v3.3

setFlippedY(flippedY)

Sets whether the widget should be flipped vertically or not.

Parameters:

flippedY

true if the widget should be flipped vertically, false otherwise.

Since:

v3.3

setInsetBottom(insetBottom)

Sets the bottom side inset

Parameters:

{number}insetBottom

setInsetLeft(insetLeft)

Sets the left side inset

Parameters:

{Number}insetLeft

setInsetRight(insetRight)

Sets the right side inset

Parameters:

{Number}insetRight

setInsetTop(insetTop)

Sets the top side inset

Parameters:

{Number}insetTop

setOpacity(opacity)

Opacity: conforms to CCRGBAProtocol protocol

Parameters:

opacity

setOpacityModifyRGB(value)

sets the premultipliedAlphaOpacity property.
If set to NO then opacity will be applied as: glColor(R,G,B,opacity);
If set to YES then opacity will be applied as: glColor(opacity, opacity, opacity, opacity );
Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO