c2ephp
|
Class for S16 sprite files. More...
Public Member Functions | |
S16File (IReader $reader) | |
Instantiates a new S16File. | |
SetEncoding ($encoding) | |
Sets the encoding (555 or 565) of this s16 file. | |
Compile () | |
Compiles the S16 file into a 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. |
Class for S16 sprite files.
TODO: Currently doesn't support creating S16s.
Definition at line 11 of file S16File.php.
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.
$frame | A SpriteFrame |
$position | Where to put the frame. Currently un-used. |
Definition at line 57 of file SpriteFile.php.
S16File::Compile | ( | ) |
Compiles the S16 file into a binary string.
Reimplemented from SpriteFile.
Definition at line 62 of file S16File.php.
SpriteFile::DeleteFrame | ( | $ | frame | ) | [inherited] |
Deletes the frame in the given position.
$frame | The 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.
$frame | The 0-based index of the frame to get. |
Definition at line 24 of file SpriteFile.php.
SpriteFile::GetFrameCount | ( | ) | [inherited] |
Gets the number of frames currently stored in this SpriteFile.
Definition at line 91 of file SpriteFile.php.
SpriteFile::GetFrames | ( | ) | [inherited] |
Gets the entire frame array.
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
$frame | A SpriteFrame of any type. |
$position | Which frame to replace. If negative, counts backwards from the end of the frames array. |
Definition at line 81 of file SpriteFile.php.
S16File::S16File | ( | IReader $ | reader | ) |
Instantiates a new S16File.
Definition at line 27 of file S16File.php.
S16File::SetEncoding | ( | $ | encoding | ) |
Sets the encoding (555 or 565) of this s16 file.
This only affects compiling the S16File. You cannot accidentally (or deliberately) read a 555 sprite file in 565 format or vise versa.
Definition at line 51 of file S16File.php.
SpriteFile::ToPNG | ( | $ | frame | ) | [inherited] |
Converts the given frame to PNG. Deprecated.
May be removed in a future release. Use GetFrame($frame)->ToPNG() instead.
$frame | The 0-based index of the frame to delete. |
Definition at line 108 of file SpriteFile.php.