SPABuilder.Frame Class Reference

Detailed Description

Represents a single frame of the animation. These are compacted onto a sprite. An spa contains multiple sprites.

Public Member Functions

 Frame (string filePath)
 Creates a new frame for the given image. More...
 
int ParseNumber ()
 Figures out the frame ID by parsing it's name. More...
 
bool LoadGraphic ()
 Attempts to load the Graphic property from the file. More...
 
void WriteInto (Graphics canvas, int x, int y)
 Writes this frame into the given canvas. More...
 

Public Attributes

int ID
 The frame number. More...
 
Image Graphic
 The graphic for the frame. More...
 
string FilePath
 The original filepath where this frame was loaded from. More...
 

Constructor & Destructor Documentation

SPABuilder.Frame.Frame ( string  filePath)
inline

Creates a new frame for the given image.

Parameters
filePathThe path to the image to create a frame from.

Member Function Documentation

bool SPABuilder.Frame.LoadGraphic ( )
inline

Attempts to load the Graphic property from the file.

Returns
True if it was successfully loaded; false otherwise.
int SPABuilder.Frame.ParseNumber ( )
inline

Figures out the frame ID by parsing it's name.

Returns
The frame ID if found; -1 otherwise.
void SPABuilder.Frame.WriteInto ( Graphics  canvas,
int  x,
int  y 
)
inline

Writes this frame into the given canvas.

Parameters
canvasThe graphics object to write this image to. Usually a sprite frame.
xThe x position in pixels to write the frame at. From the left.
yThe y position in pixels to write the frame at. From the bottom.

Member Data Documentation

string SPABuilder.Frame.FilePath

The original filepath where this frame was loaded from.

Image SPABuilder.Frame.Graphic

The graphic for the frame.

int SPABuilder.Frame.ID

The frame number.