PXAtlasFrame Class Reference
| 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
-
textureDataThe master atlas image within this frame’s sub-image is located.
property -
clipRectThe location and area of this frame’s sub-image within the master atlas image.
property -
anchorThe 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 -
paddingThe amount of padding (in points) that should exist around the sub-image represented by this frame when extracted from the texture atlas.
property -
– initWithClipRect:textureData:Initializes the PXAtlasFrame object with the given parameters.
-
– initWithClipRect:textureData:anchor:Initializes the PXAtlasFrame object with the given parameters.
-
– initWithClipRect:textureData:anchor:padding:Initializes the PXAtlasFrame object with the given parameters.
-
+ atlasFrameWithClipRect:textureData:A utility method for quicly creating a PXAtlasFrame object with the given parameters.
-
+ atlasFrameWithClipRect:textureData:anchorX:anchorY:A utility method for quicly creating a PXAtlasFrame object with the given parameters.
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 *anchorDeclared In
PXAtlasFrame.hclipRect
The location and area of this frame’s sub-image within the master atlas image.
@property (nonatomic, copy) PXClipRect *clipRectDeclared In
PXAtlasFrame.hpadding
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 *paddingDiscussion
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.hClass Methods
atlasFrameWithClipRect:textureData:
A utility method for quicly creating a PXAtlasFrame object with the given parameters.
+ (PXAtlasFrame *)atlasFrameWithClipRect:(PXClipRect *)clipRect textureData:(PXTextureData *)textureDataParameters
- 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.matlasFrameWithClipRect: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)anchorYParameters
- 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.mInstance Methods
initWithClipRect:textureData:
Initializes the PXAtlasFrame object with the given parameters.
- (id)initWithClipRect:(PXClipRect *)_clipRect textureData:(PXTextureData *)_textureDataParameters
- 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.minitWithClipRect:textureData:anchor:
Initializes the PXAtlasFrame object with the given parameters.
- (id)initWithClipRect:(PXClipRect *)_clipRect textureData:(PXTextureData *)_textureData anchor:(PXPoint *)_anchorParameters
- 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
nilfor the default value ({0, 0}).
Declared In
PXAtlasFrame.minitWithClipRect:textureData:anchor:padding:
Initializes the PXAtlasFrame object with the given parameters.
- (id)initWithClipRect:(PXClipRect *)_clipRect textureData:(PXTextureData *)_textureData anchor:(PXPoint *)_anchor padding:(PXTexturePadding *)_paddingParameters
- 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
nilfor 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