CCSprite9Slice Class Reference
Inherits from | CCSprite : CCNode : CCResponder : NSObject |
---|---|
Declared in | CCSprite9Slice.h |
Overview
CCSprite9Slice will render an image in nine quads, keeping the margins fixed and stretching the center quad to fit the content size. The effect is that the image’s borders will remain unstretched while the center stretches.
Setting the Margin
margin
Sets the margin as a normalized percentage of the total image size. If set to 0.25, 25% of the left, right, top and bottom borders of the image will remain unstretched.
@property (nonatomic, assign) float margin
Discussion
Note: Margin must be in the range 0.0 to below 0.5.
Declared In
CCSprite9Slice.h