Unit phxSprite

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

Sprite engine

Overview

Classes, Interfaces, Objects and Records

Name Description
Class EPHXSpriteError Exception class for sprites
Class TPHXSprite Basic sprite
Class TPHXSpriteList Container for a list of sprites
Class TPHXAnimatedSprite A sprite with animation
Class TPHXBackgroundSprite A tiled background sprite with support for parallax scrolling
Class TPHXSpriteFactoryItem This class is used by the sprite factory to create sprites by name
Class TPHXSpriteFactory The factory is used to create sprites by name
record TPHXSpriteCollision Contains a pair of sprites in a collision
Class TPHXSpriteCollisionList Contains a list of collision pairs
Class TPHXSpriteCollider The collider class is responsible for testing for collisions
Class TPHXSpriteCamera Sprite camera
Class TPHXSpriteEngine Sort sprites by the layer Call the collide function from the update Cull sprites that are outside the viewport Limit scrolling so it doesnt go outside the engine bounds Sprite engine

Functions and Procedures

procedure RegisterSprite(const Sprite: TPHXSpriteClass; const Name: AnsiString);
function CreateSprite(Engine: TPHXSpriteEngine; const Name: AnsiString): TPHXSprite;

Types

TPHXSpriteCollisionGroup = (...);
TPHXSpriteCollisionFilter = set of TPHXSpriteCollisionGroup;
TPHXSpriteCollisionMode = (...);
PSpriteList = ˆTSpriteList;
TSpriteList = array[0..$00FFFFFF] of TPHXSprite;
TPHXSpriteClass = class of TPHXSprite;
TPHXSpriteConstructor = function(Engine: TPHXSpriteEngine; const Name: String): TPHXSprite of object;
TSpriteFactoryItemList = array[0..$00FFFFFF] of TPHXSpriteFactoryItem;
PSpriteFactoryItemList = ˆTSpriteFactoryItemList;
TSpriteCollisionList = array[0..$00FFFFFF] of TPHXSpriteCollision;
PSpriteCollisionList = ˆTSpriteCollisionList;
TPHXSpriteOptions = set of ( soSort, soCollide, soCulling, soLimitScroll );

Constants

cfFilterNone: TPHXSpriteCollisionFilter = [];
cfFilterAll : TPHXSpriteCollisionFilter = [cgGroup1, cgGroup2, cgGroup3, cgGroup4, cgGroup5, cgGroup6, cgGroup7, cgGroup8];

Variables

SpriteRef: Integer = 0;

Description

Functions and Procedures

procedure RegisterSprite(const Sprite: TPHXSpriteClass; const Name: AnsiString);

Register a sprite class

function CreateSprite(Engine: TPHXSpriteEngine; const Name: AnsiString): TPHXSprite;

Create a instance of a previously registered sprite

Types

TPHXSpriteCollisionGroup = (...);

Collision groups for collision filtering

Values
  • cgGroup1: The sprite belongs to collision group 1
  • cgGroup2: The sprite belongs to collision group 2
  • cgGroup3: The sprite belongs to collision group 3
  • cgGroup4: The sprite belongs to collision group 4
  • cgGroup5: The sprite belongs to collision group 5
  • cgGroup6: The sprite belongs to collision group 6
  • cgGroup7: The sprite belongs to collision group 7
  • cgGroup8: The sprite belongs to collision group 8
TPHXSpriteCollisionFilter = set of TPHXSpriteCollisionGroup;

Filter for masking collisions

TPHXSpriteCollisionMode = (...);

The collision mode for a sprite

Values
  • cmStatic: The sprite is static, it will be tested for collisions but the collided function will never be called
  • cmDynamic: The sprite is a dynamic sprite it both generates and recieves collisions
PSpriteList = ˆTSpriteList;

List of sprites

TSpriteList = array[0..$00FFFFFF] of TPHXSprite;
 
TPHXSpriteClass = class of TPHXSprite;

Class of sprites

TPHXSpriteConstructor = function(Engine: TPHXSpriteEngine; const Name: String): TPHXSprite of object;

Event for creating a sprite

TSpriteFactoryItemList = array[0..$00FFFFFF] of TPHXSpriteFactoryItem;
 
PSpriteFactoryItemList = ˆTSpriteFactoryItemList;
 
TSpriteCollisionList = array[0..$00FFFFFF] of TPHXSpriteCollision;

Array of sprite collision par

PSpriteCollisionList = ˆTSpriteCollisionList;

Pointer to a array of sprite collision par

TPHXSpriteOptions = set of ( soSort, soCollide, soCulling, soLimitScroll );

Sprite options

Constants

cfFilterNone: TPHXSpriteCollisionFilter = [];

Constant for no group

cfFilterAll : TPHXSpriteCollisionFilter = [cgGroup1, cgGroup2, cgGroup3, cgGroup4, cgGroup5, cgGroup6, cgGroup7, cgGroup8];

Constant for all groups

Variables

SpriteRef: Integer = 0;

Reference counter for the sprites


Generated by PasDoc 0.13.0 on 2013-08-26 11:02:42