Container class for deserialized sprite sheet data.
More...
#include <SpriteSheet.hpp>
|
| | SpriteSheet () |
|
| ~SpriteSheet () |
| | Destructor.
|
|
SpriteSheet * | clone () const |
| | Make a duplicate of this object's instance.
|
|
const IntRect & | dimensions (int index) const |
| | Get the calculations made for a particular ID number.
|
|
int | frames () const |
| | Obtain the number of frames this object contains.
|
|
bool | empty () const |
| | Obtain whether the sprite sheet is empty or not.
|
|
std::string | version () const |
| | Get the current version of the sprite sheet file format.
|
| const std::string & | sheet_filename () const |
| | Get the sprite sheet's filename.
|
| int | sheet_width () const |
| | Get the total sprite sheet width.
|
| int | sheet_height () const |
| | Get the total sprite sheet height.
|
| int | sheet_padding () const |
| | Get the sprite sheet's padding.
|
| int | sheet_spacing () const |
| | Get the sprite sheet's spacing.
|
| int | total_frames () const |
| | Get the total number of sprite frames.
|
| bool | load_file (const std::string &filename) |
| | De-serialize an existing JSON file.
|
| bool | load_sheet_object (const Value &object) |
| | Load a sprite sheet from a de-serialized object.
|
|
bool | insert_frame (nom::size_type frame_num, const IntRect &frame_bounds) |
|
bool | append_frame (const IntRect &frame_bounds) |
|
bool | remove_frame (nom::size_type frame) |
| | Erase an existing frame from the sheet.
|
|
void | remove_frames () |
| | Destroy all stored sprite frames.
|
|
void | dump () const |
| | Dump the state of this object instance.
|
|
| std::map< int, IntRect > | sheet_ |
| | Sprite sheet container.
|
| std::string | sheet_filename_ |
| | Source filename used is saved with the output (meta-data).
|
| int | sheet_spacing_ |
| | Source spacing used is saved with the output (meta-data).
|
| int | sheet_padding_ |
| | Source padding used is saved with the output (meta-data).
|
| int | sheet_width_ |
| | Source sheet_width used is saved with the output (meta-data).
|
| int | sheet_height_ |
| | Source sheet_height used is saved with the output (meta-data).
|
| int | total_frames_ |
| | The total number of sprite frames; as per the number of objects in the frames object node.
|
Container class for deserialized sprite sheet data.
TexturePacker with a custom exporter for nomlib is used for saving sprite frame data. See Resources/SharedSupport/TexturePacker for the custom exporter used.
Definition at line 46 of file SpriteSheet.hpp.
◆ self_type
◆ SpriteSheet()
| nom::SpriteSheet::SpriteSheet |
( |
| ) |
|
Default construct for initializing instance variables to their respective defaults.
◆ load_file()
| bool nom::SpriteSheet::load_file |
( |
const std::string & | filename | ) |
|
De-serialize an existing JSON file.
- Parameters
-
| filename | The absolute file path to the JSON input. |
- Returns
- An object filled with complete data from a file on success, or a non-modified object upon failure.
- Todo
- Rename to load_sheet_file?
◆ load_sheet_object()
| bool nom::SpriteSheet::load_sheet_object |
( |
const Value & | object | ) |
|
Load a sprite sheet from a de-serialized object.
- Parameters
-
| object | An existing, de-serialized object to use. |
◆ sheet_filename()
| const std::string & nom::SpriteSheet::sheet_filename |
( |
| ) |
const |
Get the sprite sheet's filename.
◆ sheet_height()
| int nom::SpriteSheet::sheet_height |
( |
| ) |
const |
Get the total sprite sheet height.
◆ sheet_padding()
| int nom::SpriteSheet::sheet_padding |
( |
| ) |
const |
Get the sprite sheet's padding.
◆ sheet_spacing()
| int nom::SpriteSheet::sheet_spacing |
( |
| ) |
const |
Get the sprite sheet's spacing.
◆ sheet_width()
| int nom::SpriteSheet::sheet_width |
( |
| ) |
const |
Get the total sprite sheet width.
◆ total_frames()
| int nom::SpriteSheet::total_frames |
( |
| ) |
const |
Get the total number of sprite frames.
◆ sheet_
| std::map<int, IntRect> nom::SpriteSheet::sheet_ |
|
private |
◆ sheet_filename_
| std::string nom::SpriteSheet::sheet_filename_ |
|
private |
Source filename used is saved with the output (meta-data).
Definition at line 146 of file SpriteSheet.hpp.
◆ sheet_height_
| int nom::SpriteSheet::sheet_height_ |
|
private |
Source sheet_height used is saved with the output (meta-data).
Definition at line 158 of file SpriteSheet.hpp.
◆ sheet_padding_
| int nom::SpriteSheet::sheet_padding_ |
|
private |
Source padding used is saved with the output (meta-data).
Definition at line 152 of file SpriteSheet.hpp.
◆ sheet_spacing_
| int nom::SpriteSheet::sheet_spacing_ |
|
private |
Source spacing used is saved with the output (meta-data).
Definition at line 149 of file SpriteSheet.hpp.
◆ sheet_width_
| int nom::SpriteSheet::sheet_width_ |
|
private |
Source sheet_width used is saved with the output (meta-data).
Definition at line 155 of file SpriteSheet.hpp.
◆ total_frames_
| int nom::SpriteSheet::total_frames_ |
|
private |
The total number of sprite frames; as per the number of objects in the frames object node.
Definition at line 162 of file SpriteSheet.hpp.
◆ VERSION
The documentation for this class was generated from the following file:
- /home/jeff/Projects/nomlib.git/include/nomlib/graphics/sprite/SpriteSheet.hpp