Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::CSpriteAtlas Class Reference

The object class holds data on an image, including the locations of sprites and frames on it. More...

#include <Graphics2D/SpriteFrame/CSpriteAtlas.h>

Inheritance diagram for Skylicht::CSpriteAtlas:
Skylicht::CSpriteFrame

Public Member Functions

 CSpriteAtlas (ECOLOR_FORMAT format, int width, int height)
SFrameaddFrame (const char *name, const char *path, const char *frameId=NULL)
SImagecreateAtlasRect (int w, int h, core::recti &outRegion)
void updateTexture ()
std::vector< SModuleRect * > & getModules ()
std::vector< SFrame * > & getFrames ()
std::vector< SImage * > & getImages ()
int getWidth ()
int getHeight ()
Public Member Functions inherited from Skylicht::CSpriteFrame
bool load (const char *fileName)
std::vector< SFrame * > & getFrames ()
SFramegetFrameByName (const char *name)
SFramegetFrameById (const char *id)
const char * getId ()
const char * getPath ()

Protected Member Functions

SImageaddEmptyAtlas ()

Protected Attributes

int m_width
int m_height
ECOLOR_FORMAT m_fmt
Protected Attributes inherited from Skylicht::CSpriteFrame
std::vector< SImage * > m_images
std::vector< SFrame * > m_frames
std::vector< SModuleRect * > m_modules
std::map< std::string, SFrame * > m_names
std::map< std::string, SFrame * > m_ids
bool m_deleteAtlas
std::string m_id
std::string m_path

Detailed Description

The object class holds data on an image, including the locations of sprites and frames on it.

CSpriteAtlas* sprite = new CSpriteAtlas(video::ECF_A8R8G8B8, 1024, 1024);
SFrame* btnYellowBackground = sprite->addFrame("btn_yellow.png", "LuckyDraw/btn_yellow.png");
Definition CSpriteFrame.h:93

Then, use the CGraphics2D object or the CGUISprite, CGUIFitSprite to draw this sprite and image.


The documentation for this class was generated from the following file: