PXSprite Class Reference
| 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
-
graphicsThe graphics object that belongs to the sprite where vector drawing is done.
property -
hitAreaAssigns another PXDisplayObject or PXRectangle as the hit area of the sprite. If the
propertyhitAreaisnil, as by default, the contents of the sprite are used as the hit area. -
+ spriteWithChild:A utility method for quickly creating a PXSprite containing the specified child object.
-
+ spriteWithChildren:A utility method for quickly creating a PXSprite containing the specified children objects.
Properties
graphics
The graphics object that belongs to the sprite where vector drawing is done.
@property (nonatomic, readonly) PXGraphics *graphicsDeclared In
PXSprite.hhitArea
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> hitAreaDiscussion
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.hClass Methods
spriteWithChild:
A utility method for quickly creating a PXSprite containing the specified child object.
+ (PXSprite *)spriteWithChild:(PXDisplayObject *)childParameters
- child
A display object to add to the created PXSprite
Return Value
An autoareleased PXSimpleSprite
Declared In
PXSprite.mspriteWithChildren:
A utility method for quickly creating a PXSprite containing the specified children objects.
+ (PXSprite *)spriteWithChildren:(NSArray *)childrenParameters
- children
A list of children to add to the created PXSprite
Return Value
An autoareleased PXSimpleSprite
Declared In
PXSprite.m