Inherits from NSObject
Declared in PXAtlasFrame.h
PXAtlasFrame.m

Overview

Represents a sub-image within a PXTextureAtlas object.

A PXAtlasFrame is a simple data object containing information about the sub-image such as its location within the master atlas image and how it should be translated, rotated, and padded before being displayed on the screen.

Tasks

Properties

anchor

The anchor point to be used when this frame is extracted from the texture atlas. The anchor point is defined in percent values within the sub-image’s frame.

@property (nonatomic, copy) PXPoint *anchor

Declared In

PXAtlasFrame.h

clipRect

The location and area of this frame’s sub-image within the master atlas image.

@property (nonatomic, copy) PXClipRect *clipRect

Declared In

PXAtlasFrame.h

padding

The amount of padding (in points) that should exist around the sub-image represented by this frame when extracted from the texture atlas.

@property (nonatomic, copy) PXTexturePadding *padding

Discussion

This padding doesn’t actually exist in the atlas image, but is used ‘inflate’ it, adding back any white-space it had before being added to the texture atlas.

Declared In

PXAtlasFrame.h

textureData

The master atlas image within this frame’s sub-image is located.

@property (nonatomic, retain) PXTextureData *textureData

Declared In

PXAtlasFrame.h

Class Methods

atlasFrameWithClipRect:textureData:

A utility method for quicly creating a PXAtlasFrame object with the given parameters.

+ (PXAtlasFrame *)atlasFrameWithClipRect:(PXClipRect *)clipRect textureData:(PXTextureData *)textureData

Parameters

clipRect

The position and area (in points) of the sub-image within the master atlas image.

textureData

The PXTextureData within which this sub-image is contained.

Return Value

An auto-released PXAtlasFrame object with the given parameters.

Declared In

PXAtlasFrame.m

atlasFrameWithClipRect:textureData:anchorX:anchorY:

A utility method for quicly creating a PXAtlasFrame object with the given parameters.

+ (PXAtlasFrame *)atlasFrameWithClipRect:(PXClipRect *)clipRect textureData:(PXTextureData *)textureData anchorX:(float)anchorX anchorY:(float)anchorY

Parameters

clipRect

The position and area (in points) of the sub-image within the master atlas image.

textureData

The PXTextureData within which this sub-image is contained.

anchorX

The anchorX amount (in percent) to be assigned to this sub-image when extracted from the texture atlas.

anchorY

The anchorY amount (in percent) to be assigned to this sub-image when extracted from the texture atlas.

Return Value

An auto-released PXAtlasFrame object with the given parameters.

Declared In

PXAtlasFrame.m

Instance Methods

initWithClipRect:textureData:

Initializes the PXAtlasFrame object with the given parameters.

- (id)initWithClipRect:(PXClipRect *)_clipRect textureData:(PXTextureData *)_textureData

Parameters

textureData

The PXTextureData within which this sub-image is contained.

clipRect

The position and area (in points) of the sub-image within the master atlas image.

Declared In

PXAtlasFrame.m

initWithClipRect:textureData:anchor:

Initializes the PXAtlasFrame object with the given parameters.

- (id)initWithClipRect:(PXClipRect *)_clipRect textureData:(PXTextureData *)_textureData anchor:(PXPoint *)_anchor

Parameters

textureData

The PXTextureData within which this sub-image is contained.

clipRect

The position and area (in points) of the sub-image within the master atlas image.

anchor

The anchor point to be assigned to this sub-image when extracted from the texture atlas. Pass nil for the default value ({0, 0}).

Declared In

PXAtlasFrame.m

initWithClipRect:textureData:anchor:padding:

Initializes the PXAtlasFrame object with the given parameters.

- (id)initWithClipRect:(PXClipRect *)_clipRect textureData:(PXTextureData *)_textureData anchor:(PXPoint *)_anchor padding:(PXTexturePadding *)_padding

Parameters

clipRect

The position and area (in points) of the sub-image within the master atlas image.

anchor

The anchor point to be assigned to this sub-image when extracted from the texture atlas. Pass nil for the default value ({0, 0}).

padding

The amount of padding (white space) that should exists around the sub-image when extracted from the texture atlas.

textureData

The PXTextureData within which this sub-image is contained.

Declared In

PXAtlasFrame.m