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
rotated
isYES
, 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
-
parent
The texture which the subtexture is based on.
property -
clipping
The clipping rectangle, which is the region provided on initialization, scaled into [0.0, 1.0].
property -
transformationMatrix
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
Properties
clipping
The clipping rectangle, which is the region provided on initialization, scaled into [0.0, 1.0].
@property (nonatomic, readonly) SPRectangle *clipping
Discussion
The clipping rectangle, which is the region provided on initialization, scaled into [0.0, 1.0].
Declared In
SPSubTexture.h
parent
The texture which the subtexture is based on.
@property (nonatomic, readonly) SPTexture *parent
Discussion
The texture which the subtexture is based on.
Declared In
SPSubTexture.h
transformationMatrix
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 *transformationMatrix
Discussion
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.h
Instance 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 *)texture
Discussion
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.h
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 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 *)texture
Discussion
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