Inherits from PXDisplayObjectContainer : PXInteractiveObject : PXDisplayObject : PXEventDispatcher : NSObject
Declared in PXSprite.h
PXSprite.m

Overview

A PXSprite is a concrete display object that can contain children and has a graphics object.

Tasks

Properties

graphics

The graphics object that belongs to the sprite where vector drawing is done.

@property (nonatomic, readonly) PXGraphics *graphics

Declared In

PXSprite.h

hitArea

Assigns another PXDisplayObject or PXRectangle as the hit area of the sprite. If the hitArea is nil, as by default, the contents of the sprite are used as the hit area.

@property (nonatomic, retain) id<NSObject> hitArea

Discussion

The hitArea of a sprite describes the area within which it can receive touch events. The value of hitArea can be a PXDisplayObject or a PXRectangle. You can change the value of this property at any time, and it will take effect immediately. If the hitArea is a PXDisplayObject it doesn’t have to be visible or be on the the display list as only its shape is used for hit testing.

Declared In

PXSprite.h

Class Methods

spriteWithChild:

A utility method for quickly creating a PXSprite containing the specified child object.

+ (PXSprite *)spriteWithChild:(PXDisplayObject *)child

Parameters

child

A display object to add to the created PXSprite

Return Value

An autoareleased PXSimpleSprite

Declared In

PXSprite.m

spriteWithChildren:

A utility method for quickly creating a PXSprite containing the specified children objects.

+ (PXSprite *)spriteWithChildren:(NSArray *)children

Parameters

children

A list of children to add to the created PXSprite

Return Value

An autoareleased PXSimpleSprite

Declared In

PXSprite.m