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

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

Class Methods

textureWithRegion:ofTexture:

Factory method.

+ (instancetype)textureWithRegion:(SPRectangle *)region ofTexture:(SPTexture *)texture

Discussion

Factory method.

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

initWithRegion:ofTexture:

Initializes a subtexture with a region (in points) of another texture.

- (instancetype)initWithRegion:(SPRectangle *)region ofTexture:(SPTexture *)texture

Discussion

Initializes a subtexture with a region (in points) of another texture.

Declared In

SPSubTexture.h