SPSubTexture Class Reference
| Inherits from | SPTexture : NSObject |
| Declared in | SPSubTexture.h |
Overview
An SPSubTexture represents a section of another texture. This is achieved solely by manipulation of texture coordinates, making the class very efficient.
Note that it is OK to create subtextures of subtextures.
Tasks
Initialization
-
– initWithRegion:frame:rotated:ofTexture:Initializes a subtexture with a region (in points) of another texture, using a frame rectangle to place the texture within an image. If
rotatedisYES, the subtexture will show the base region rotated by 90 degrees (CCW). Designated Initializer. -
– initWithRegion:frame:ofTexture:Initializes a subtexture with a region (in points) of another texture, using a frame rectangle to place the texture within an image.
-
– initWithRegion:ofTexture:Initializes a subtexture with a region (in points) of another texture.
-
+ textureWithRegion:ofTexture:Factory method.
Properties
-
parentThe texture which the subtexture is based on.
property -
clippingThe clipping rectangle, which is the region provided on initialization, scaled into [0.0, 1.0].
property -
transformationMatrixThe matrix that is used to transform the texture coordinates into the coordinate space of the parent texture (used internally by the “adjust…”-methods). CAUTION: Use with care! Each call returns the same instance.
property
Properties
clipping
The clipping rectangle, which is the region provided on initialization, scaled into [0.0, 1.0].
@property (nonatomic, readonly) SPRectangle *clippingDiscussion
The clipping rectangle, which is the region provided on initialization, scaled into [0.0, 1.0].
Declared In
SPSubTexture.hparent
The texture which the subtexture is based on.
@property (nonatomic, readonly) SPTexture *parentDiscussion
The texture which the subtexture is based on.
Declared In
SPSubTexture.htransformationMatrix
The matrix that is used to transform the texture coordinates into the coordinate space of the parent texture (used internally by the “adjust…”-methods). CAUTION: Use with care! Each call returns the same instance.
@property (nonatomic, readonly) SPMatrix *transformationMatrixDiscussion
The matrix that is used to transform the texture coordinates into the coordinate space of the parent texture (used internally by the “adjust…”-methods). CAUTION: Use with care! Each call returns the same instance.
Declared In
SPSubTexture.hInstance Methods
initWithRegion:frame:ofTexture:
Initializes a subtexture with a region (in points) of another texture, using a frame rectangle to place the texture within an image.
- (instancetype)initWithRegion:(SPRectangle *)region frame:(SPRectangle *)frame ofTexture:(SPTexture *)textureDiscussion
Initializes a subtexture with a region (in points) of another texture, using a frame rectangle to place the texture within an image.
Declared In
SPSubTexture.hinitWithRegion:frame:rotated:ofTexture:
Initializes a subtexture with a region (in points) of another texture, using a frame rectangle
to place the texture within an image. If rotated is YES, the subtexture will show the base
region rotated by 90 degrees (CCW). Designated Initializer.
- (instancetype)initWithRegion:(SPRectangle *)region frame:(SPRectangle *)frame rotated:(BOOL)rotated ofTexture:(SPTexture *)textureDiscussion
Initializes a subtexture with a region (in points) of another texture, using a frame rectangle
to place the texture within an image. If rotated is YES, the subtexture will show the base
region rotated by 90 degrees (CCW). Designated Initializer.
Declared In
SPSubTexture.h