Class Tsprite (unit Usprite)

Inherits from

Tgraph

Constructors


constructor CreateFmBmp(BitmapFile:string;Transparent:TTransparent; Compressed:TCompressed;Images:byte;hdc:Thandle);


constructor CreateFmRes(RessourceName:string; Transparent:TTransparent; Compressed:TCompressed;Images:byte;hdc:Thandle);



Functions

destructor destroy;

TSprite

procedure DrawBitmap(hdc:Thandle);

will return the modified rectangle

function DrawGraph(hdc:Thandle):Trect;


Procedure InitVariables(Transparent:TTransparent; Compressed:TCompressed;Images:byte);


procedure SetEventRect(const Arect:Trect);


Properties

property Bounce : boolean


property EventRect : TRect

will mirror bitmap when speed x is negative.

property ImageRefresh : byte


property Reversed : boolean


property speedx : integer

for debug purpose only

property speedy : integer


Events

event OnBorderEvent : TNotifyEvent


event OnEventrect : TNotifyEvent


Variables

Fbitmap : HBITMAP;


FBitmapBgd : HBITMAP;


FBitmapMask : HBITMAP;


FBitmapTemp : HBITMAP;


FBounce : boolean;


FClipREct : Trect;


FCompressed : boolean;


FCountTick : Longint;


FEventRect : TRect;

this prevent the event from firing again

FEventTrigger : Boolean;


FFirstDisplay : boolean;


FFirstEventRect : boolean;


FimageCount : byte;


FimageRef : byte;


Fimages : byte;


Flastposx : integer;


Flastposy : integer;


FLastSpriteInPartial : boolean;


FOnBorderEvent : TNotifyEvent;


FOnEventRect : TNotifyEvent;


FReversed : boolean;


Fspeedx : integer;

starts with 0

Fspeedy : integer;


FSpriteRect : Trect;


FTransparent : boolean;



Constructors


constructor CreateFmBmp(BitmapFile:string;Transparent:TTransparent; Compressed:TCompressed;Images:byte;hdc:Thandle);


constructor CreateFmRes(RessourceName:string; Transparent:TTransparent; Compressed:TCompressed;Images:byte;hdc:Thandle);


Functions


destructor destroy;

TSprite


procedure DrawBitmap(hdc:Thandle);

will return the modified rectangle


function DrawGraph(hdc:Thandle):Trect;


Procedure InitVariables(Transparent:TTransparent; Compressed:TCompressed;Images:byte);


procedure SetEventRect(const Arect:Trect);


Properties


property Bounce : boolean


property EventRect : TRect

will mirror bitmap when speed x is negative. It is assumed that the initial bitmap is for positive speed ie left to right. This can be slow especialy if you have a large bitmap in transparent mode


property ImageRefresh : byte


property Reversed : boolean


property speedx : integer

for debug purpose only


property speedy : integer


Events


event OnBorderEvent : TNotifyEvent


event OnEventrect : TNotifyEvent


Variables


Fbitmap : HBITMAP;


FBitmapBgd : HBITMAP;


FBitmapMask : HBITMAP;


FBitmapTemp : HBITMAP;


FBounce : boolean;


FClipREct : Trect;


FCompressed : boolean;


FCountTick : Longint;


FEventRect : TRect;

this prevent the event from firing again


FEventTrigger : Boolean;


FFirstDisplay : boolean;


FFirstEventRect : boolean;


FimageCount : byte;


FimageRef : byte;


Fimages : byte;


Flastposx : integer;


Flastposy : integer;


FLastSpriteInPartial : boolean;


FOnBorderEvent : TNotifyEvent;


FOnEventRect : TNotifyEvent;


FReversed : boolean;


Fspeedx : integer;

starts with 0


Fspeedy : integer;


FSpriteRect : Trect;


FTransparent : boolean;