29 #ifndef NOMLIB_SPRITE_SHEET_HPP
30 #define NOMLIB_SPRITE_SHEET_HPP
41 #include "nomlib/config.hpp"
42 #include "nomlib/version.hpp"
43 #include "nomlib/math/Coords.hpp"
44 #include "nomlib/json/FileReader.hpp"
45 #include "nomlib/json/FileWriter.hpp"
49 extern const int NOM_SPRITE_SHEET_MAJOR_VERSION;
50 extern const int NOM_SPRITE_SHEET_MINOR_VERSION;
51 extern const int NOM_SPRITE_SHEET_PATCH_VERSION;
56 #define NOM_DEBUG_SPRITE_SHEET_JSON_SAVE
65 typedef std::shared_ptr<SpriteSheet> SharedPtr;
89 const std::string& filename,
91 int32 sprite_width, int32 sprite_height,
92 int32 spacing, int32 padding, int32 num_sprites
96 SpriteSheet::SharedPtr
clone (
void )
const;
102 int32
frames (
void )
const;
104 const std::string& sheet_filename (
void )
const;
108 bool save (
const std::string& filename );
112 bool load (
const std::string& filename );
115 void dump (
void )
const;
144 #endif // include guard defined
int32 frames(void) const
Obtain the number of frames this object contains.
bool load(const std::string &filename)
int32 sheet_padding
Source padding used is saved with the output (meta-data)
std::string sheet_filename_
Source filename used is saved with the output (meta-data)
int32 sheet_spacing
Source spacing used is saved with the output (meta-data)
void dump(void) const
Dump the state of this object instance.
Specialized class container for the creation of sprite sheets via RFC 4627 JSON-compliant file input...
SpriteSheet::SharedPtr clone(void) const
Make a duplicate of this object's instance.
int32 sheet_width
Source sheet_width used is saved with the output (meta-data)
bool save(const std::string &filename)
std::vector< Coords > sheet
Our sprite sheet values container.
~SpriteSheet(void)
Destructor.
Coordinate values (x, y, z, width, height ) wrapper.
const Coords & dimensions(int32 index) const
Get the calculations made for a particular ID number.
int32 sheet_height
Source sheet_height used is saved with the output (meta-data)