AgateLib.Sprites.Old.SpriteFrame Class Reference

Class for a single frame of a sprite. More...

Inheritance diagram for AgateLib.Sprites.Old.SpriteFrame:

AgateLib.DisplayLib.ISpriteFrame

List of all members.

Public Member Functions

void Dispose ()
 Reduces the reference counter for this class, and disposes of unmanaged resources if the counter hits zero.
void AddRef ()
 Adds one to the reference counter.
SpriteFrame Clone ()
 Copies this object.
void SetFrameNoTrim (Surface srcSurface, Point offset, Size originalSize)
 Sets the frame of this object, and does not trim it.
void SetFrame (Surface srcSurface, Point location, Size size)
 Sets the frame from a section of the source surface.
void SetFrame (Surface srcSurface, int x, int y, int width, int height)
 Sets the frame from a section of the source surface.
void SetFrame (Surface srcSurface, Rectangle rect)
 Sets the frame from a section of the source surface.
void Draw (float dest_x, float dest_y, float rotationCenterX, float rotationCenterY)
 Draws this surface at the specified destination point with the specified rotation center.

Properties

bool IsDisposed [get]
 Returns true if the internal unmanaged resources have been disposed. This happens when Dispose is called until the reference count is zero.
bool IsBlank [get]
 Returns true if the entire frame is transparent.
Surface Surface [get]
 Returns the surface object which is drawn.
Size DisplaySize [get, set]
 Gets or sets the display size.
Size OriginalSize [get]
 Gets the original size of the frame.
Point FrameOffset [get]
 Gets the draw offset of the frame.


Detailed Description

Class for a single frame of a sprite.

This class can automatically trim the frame, so that extra space around the object which is transparent is not drawn. This is taken advantage of if surfaces are packed to create a tighter packing and fit more objects on the same texture.

SpriteFrame contains a reference count. If you manually copy it, be sure to call AddRef unless you use the Clone method.


Member Function Documentation

void AgateLib.Sprites.Old.SpriteFrame.AddRef (  ) 

Adds one to the reference counter.

SpriteFrame AgateLib.Sprites.Old.SpriteFrame.Clone (  ) 

Copies this object.

Actually, this just increases the reference counter and returns this object. Be sure to Dispose the result when finished with it.

Returns:

void AgateLib.Sprites.Old.SpriteFrame.Dispose (  ) 

Reduces the reference counter for this class, and disposes of unmanaged resources if the counter hits zero.

void AgateLib.Sprites.Old.SpriteFrame.Draw ( float  dest_x,
float  dest_y,
float  rotationCenterX,
float  rotationCenterY 
)

Draws this surface at the specified destination point with the specified rotation center.

Parameters:
dest_x 
dest_y 
rotationCenterX 
rotationCenterY 

Implements AgateLib.DisplayLib.ISpriteFrame.

void AgateLib.Sprites.Old.SpriteFrame.SetFrame ( Surface  srcSurface,
Rectangle  rect 
)

Sets the frame from a section of the source surface.

Parameters:
srcSurface 
rect 

void AgateLib.Sprites.Old.SpriteFrame.SetFrame ( Surface  srcSurface,
int  x,
int  y,
int  width,
int  height 
)

Sets the frame from a section of the source surface.

Parameters:
srcSurface 
x 
y 
width 
height 

void AgateLib.Sprites.Old.SpriteFrame.SetFrame ( Surface  srcSurface,
Point  location,
Size  size 
)

Sets the frame from a section of the source surface.

Parameters:
srcSurface 
location 
size 

void AgateLib.Sprites.Old.SpriteFrame.SetFrameNoTrim ( Surface  srcSurface,
Point  offset,
Size  originalSize 
)

Sets the frame of this object, and does not trim it.

Parameters:
srcSurface 
offset 
originalSize 


Property Documentation

Size AgateLib.Sprites.Old.SpriteFrame.DisplaySize [get, set]

Gets or sets the display size.

Point AgateLib.Sprites.Old.SpriteFrame.FrameOffset [get]

Gets the draw offset of the frame.

bool AgateLib.Sprites.Old.SpriteFrame.IsBlank [get]

Returns true if the entire frame is transparent.

bool AgateLib.Sprites.Old.SpriteFrame.IsDisposed [get]

Returns true if the internal unmanaged resources have been disposed. This happens when Dispose is called until the reference count is zero.

Size AgateLib.Sprites.Old.SpriteFrame.OriginalSize [get]

Gets the original size of the frame.

Surface AgateLib.Sprites.Old.SpriteFrame.Surface [get]

Returns the surface object which is drawn.

Implements AgateLib.DisplayLib.ISpriteFrame.


The documentation for this class was generated from the following file:
AgateLib
Awesome Game and Tool Engine Library
SourceForge.net Logo