27#include "CGUIElement.h"
28#include "Graphics2D/SpriteFrame/CSpriteFrame.h"
80 float m_defaultOffsetY;
84 std::string m_frameName;
86 std::string m_spriteId;
157 return m_frameName.c_str();
166 return m_sprite.c_str();
175 return m_spriteId.c_str();
216 void setFrameSource(
const char* spritePath,
const char* frameName,
const char* editorFileRef = NULL);
This is an object class used to set up the camera, including its position, viewing angle,...
Definition CCamera.h:70
virtual CObjectSerializable * createSerializable()
Create a serializable object for saving state.
void setStretch(bool b)
Set stretching mode.
Definition CGUISprite.h:191
void setOffsetModule(float x, float y)
Set manual offset for the module.
virtual void loadSerializable(CObjectSerializable *object)
Load state from a serializable object.
void setAlignCenterModule()
Align the frame to the center.
void setAlignModuleDefault()
Restore the default module alignment.
void setFrame(SFrame *frame)
Set the sprite frame to display.
Definition CGUISprite.h:137
virtual void render(CCamera *camera)
Render the sprite frame.
bool m_autoRotate
Enables auto - rotation of the sprite.
Definition CGUISprite.h:61
CGUISprite(CCanvas *canvas, CGUIElement *parent, SFrame *frame)
Constructor with frame.
const char * getFrameName()
Get the frame name.
Definition CGUISprite.h:155
const char * getSpriteName()
Get the sprite name (path).
Definition CGUISprite.h:164
std::string m_guid
Identifiers for serialization and sprite management.
Definition CGUISprite.h:83
const char * getFrameId()
Get the frame ID (GUID).
Definition CGUISprite.h:182
void setFrameSource(const char *spritePath, const char *frameName, const char *editorFileRef=NULL)
Set the frame source by sprite path and frame name.
void setAutoRotate(bool rotate, float rotateAngle, float framePerSec)
Enable auto-rotation with parameters.
bool isStretch()
Check whether stretching is enabled.
Definition CGUISprite.h:200
float m_animationTime
Time accumulator for animation.
Definition CGUISprite.h:70
void reloadSpriteFrame()
Reload the sprite frame by stored identifiers.
SFrame * m_frame
Pointer to the current sprite frame.
Definition CGUISprite.h:58
bool m_stretch
Enables stretching the sprite to fill the rectangle.
Definition CGUISprite.h:73
const char * getSpriteId()
Get the sprite ID.
Definition CGUISprite.h:173
virtual void update(CCamera *camera)
Update element state (auto-rotation, etc.).
bool m_isCenter
Flag the frame is centered.
Definition CGUISprite.h:76
SFrame * getFrame()
Get the current sprite frame.
Definition CGUISprite.h:146
virtual const core::rectf getNativeRect()
Get the native rectangle of the frame. The native rectangle is a rectangle whose size matches the siz...
float m_defaultOffsetX
Default offsets for module alignment.
Definition CGUISprite.h:79
float m_frameSpeed
Interval between rotations(milliseconds).
Definition CGUISprite.h:67
CGUISprite(CCanvas *canvas, CGUIElement *parent, const core::rectf &rect, SFrame *frame)
Constructor with rectangle and frame.
float m_frameRotate
Rotation angle per frame(degrees).
Definition CGUISprite.h:64
virtual ~CGUISprite()
Destructor.
Definition CObjectSerializable.h:36
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29
rect< f32 > rectf
Rectangle with float values.
Definition rect.h:271
Definition CSpriteFrame.h:93