c2ephp

C16File Class Reference

Class representing a C16 sprite file. More...

Inheritance diagram for C16File:
Collaboration diagram for C16File:

List of all members.

Public Member Functions

 C16File (IReader $reader=null)
 Creates a new C16File object.
 SetEncoding ($encoding)
 Sets the encoding for this file.
 Compile ()
 Compiles the file's data into a C16 binary string.
 GetFrame ($frame)
 Gets a SpriteFrame from the SpriteFile.
 GetFrames ()
 Gets the entire frame array.
 AddFrame (SpriteFrame $frame, $position=false)
 Adds a SpriteFrame to the SpriteFile.
 ReplaceFrame (SpriteFrame $frame, $position)
 Replaces a frame in the SpriteFile.
 GetFrameCount ()
 Gets the number of frames currently stored in this SpriteFile.
 DeleteFrame ($frame)
 Deletes the frame in the given position.
 ToPNG ($frame)
 Converts the given frame to PNG. Deprecated.

Detailed Description

Class representing a C16 sprite file.

Definition at line 7 of file C16File.php.


Member Function Documentation

SpriteFile::AddFrame ( SpriteFrame frame,
position = false 
) [inherited]

Adds a SpriteFrame to the SpriteFile.

If necessary, this function converts the SpriteFrame to the correct format. At the moment, this can only add a SpriteFrame to the end of the SpriteFile. TODO: I aim to fix this by the CCSF 2011.

Parameters:
$frameA SpriteFrame
$positionWhere to put the frame. Currently un-used.

Definition at line 57 of file SpriteFile.php.

C16File::C16File ( IReader reader = null)

Creates a new C16File object.

If $reader is null, creates an empty C16File ready to add sprites to.

Parameters:
$readerThe reader to read the sprites from. Can be null.

Definition at line 19 of file C16File.php.

C16File::Compile ( )

Compiles the file's data into a C16 binary string.

Returns:
A binary string containing the C16File's data.

Reimplemented from SpriteFile.

Definition at line 58 of file C16File.php.

SpriteFile::DeleteFrame ( frame) [inherited]

Deletes the frame in the given position.

Parameters:
$frameThe 0-based index of the frame to delete.

Definition at line 98 of file SpriteFile.php.

SpriteFile::GetFrame ( frame) [inherited]

Gets a SpriteFrame from the SpriteFile.

Parameters:
$frameThe 0-based index of the frame to get.
Returns:
A SpriteFrame

Definition at line 24 of file SpriteFile.php.

SpriteFile::GetFrameCount ( ) [inherited]

Gets the number of frames currently stored in this SpriteFile.

Returns:
The number of frames

Definition at line 91 of file SpriteFile.php.

SpriteFile::GetFrames ( ) [inherited]

Gets the entire frame array.

Returns:
An array of SpriteFrames

Definition at line 31 of file SpriteFile.php.

SpriteFile::ReplaceFrame ( SpriteFrame frame,
position 
) [inherited]

Replaces a frame in the SpriteFile.

Replaces the frame in the given position Uses the same magic as AddFrame

Parameters:
$frameA SpriteFrame of any type.
$positionWhich frame to replace. If negative, counts backwards from the end of the frames array.

Definition at line 81 of file SpriteFile.php.

C16File::SetEncoding ( encoding)

Sets the encoding for this file.

Parameters:
$encoding'565' or '555', anything else will be treated as '555'

Definition at line 50 of file C16File.php.

SpriteFile::ToPNG ( frame) [inherited]

Converts the given frame to PNG. Deprecated.

May be removed in a future release. Use GetFrame($frame)->ToPNG() instead.

Parameters:
$frameThe 0-based index of the frame to delete.
Returns:
A binary string containing a PNG.

Definition at line 108 of file SpriteFile.php.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations