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

This is the object class for displaying a texture image. More...

#include <Graphics2D/GUI/CGUIImage.h>

Inheritance diagram for Skylicht::CGUIImage:
Skylicht::CGUIElement

Public Member Functions

virtual void render (CCamera *camera)
virtual const core::rectf getNativeRect ()
void setImage (ITexture *texture)
void setImageResource (const char *path, const char *editorRefId)
const char * getResourceId ()
ITexturegetImage ()
void setSourceRect (float x, float y, float w, float h)
void setPivot (float x, float y)
const core::position2dfgetPivot ()
virtual CObjectSerializablecreateSerializable ()
virtual void loadSerializable (CObjectSerializable *object)
Public Member Functions inherited from Skylicht::CGUIElement
void remove ()
void removeAllChilds ()
CCanvas * getCanvas ()
CGUIElement * getParent ()
void setName (const char *name)
const char * getName ()
const char * getID ()
void setTagInt (int i)
void setTagString (const char *s)
int getTagInt ()
const std::string & getTagString ()
void setName (const wchar_t *name)
std::wstring getNameW ()
void setParent (CGUIElement *parent)
std::vector< CGUIElement * > & getChilds ()
void getAllChilds (std::vector< CGUIElement * > &childs)
void setColor (const SColor &c)
const SColorgetColor ()
float getHeight ()
float getWidth ()
void setHeight (float h)
void setWidth (float w)
const core::rectfgetRect ()
int getDepth ()
int getRenderOrder ()
void setDock (EGUIDock dock)
EGUIDock getDock ()
const SMargingetMargin ()
void setMargin (const SMargin &m)
void setMargin (float l, float t, float r, float b)
void setRect (const core::rectf &r)
void setWorldTransform (const core::matrix4 &world)
void setRelativeTransform (const core::matrix4 &relative)
const core::vector3df getAlignPosition ()
const core::vector3dfgetPosition ()
void invalidate ()
void setPosition (const core::vector3df &v)
const core::vector3dfgetScale ()
void setScale (const core::vector3df &v)
const core::vector3dfgetRotation ()
void setRotation (const core::vector3df &v)
core::quaternion getRotationQuaternion ()
EGUIVerticalAlign getVerticalAlign ()
EGUIHorizontalAlign getHorizontalAlign ()
void setVerticalAlign (EGUIVerticalAlign a)
void setHorizontalAlign (EGUIHorizontalAlign a)
void setAlign (EGUIHorizontalAlign h, EGUIVerticalAlign v)
void setShaderID (int id)
int getShaderID ()
int getMaterialId ()
void setMaterialId (int id)
void setMaterial (CMaterial *material)
void setMaterialSource (const char *materialFile)
CMaterialgetMaterial ()
CGUIMaskgetMask ()
CGUIMaskgetParentMask ()
void setMask (CGUIMask *mask)
void setDrawBorder (bool b)
bool isEnableMaterial ()
virtual void update (CCamera *camera)
const core::matrix4getRelativeTransform ()
const core::matrix4getAbsoluteTransform ()
void setVisible (bool b)
bool isVisible ()
bool isVisibleInHierarchy ()
CEntitygetEntity ()
void notifyChanged ()
CGUIElement * getChildBefore (CGUIElement *object)
void bringToNext (CGUIElement *object, CGUIElement *target, bool behind)
void bringToChild (CGUIElement *object)
bool isChild (CGUIElement *e)
CGUIElement * getGUIByPath (const char *path)
void generateNewId ()

Protected Member Functions

 CGUIImage (CCanvas *canvas, CGUIElement *parent)
 CGUIImage (CCanvas *canvas, CGUIElement *parent, const core::rectf &rect)
Protected Member Functions inherited from Skylicht::CGUIElement
 CGUIElement (CCanvas *canvas, CGUIElement *parent)
 CGUIElement (CCanvas *canvas, CGUIElement *parent, const core::rectf &rect)
void applyCurrentMask (CGUIMask *mask)
CGUIMaskgetCurrentMask ()
bool removeChild (CGUIElement *child)

Protected Attributes

ITexturem_image
std::string m_resource
std::string m_id
core::rectf m_sourceRect
core::position2df m_pivot
Protected Attributes inherited from Skylicht::CGUIElement
CGUIElement * m_parent
std::vector< CGUIElement * > m_childs
CCanvas * m_canvas
CGUIMaskm_mask
CGUIMaskm_applyCurrentMask
bool m_drawBorder
bool m_enableMaterial
int m_renderOrder
ArrayMaterial m_materials
int m_materialId
CEntitym_entity
CWorldTransformDatam_transform
CGUITransformDatam_guiTransform
CGUIAlignDatam_guiAlign
CGUIRenderDatam_renderData
std::string m_materialFile
int m_tagInt
std::string m_tagString

Friends

class CCanvas

Additional Inherited Members

Public Attributes inherited from Skylicht::CGUIElement
std::function< void(CGUIElement *)> OnRender

Detailed Description

This is the object class for displaying a texture image.

CCanvas *canvas = gameobject->addComponent<CCanvas>();
core::rectf r(0.0f, 0.0f, 100.0f, 100.0f);
CGUIImage* gui = canvas->createImage(r);
gui->setImage(CTextureManager::getInstance()->getTexture("BuiltIn/Textures/Skylicht.png"));
This class manages GUI components, including creating and deleting images and sprites.
Definition CCanvas.h:79
CGUIImage * createImage()
Create an image element as a child of root.
rect< f32 > rectf
Rectangle with float values.
Definition rect.h:271
The gui namespace contains useful classes for easy creation of a graphical user interface.
Definition ICursorControl.h:15

Member Function Documentation

◆ createSerializable()

virtual CObjectSerializable * Skylicht::CGUIImage::createSerializable ( )
virtual

Reimplemented from Skylicht::CGUIElement.

◆ getNativeRect()

virtual const core::rectf Skylicht::CGUIImage::getNativeRect ( )
virtual

Reimplemented from Skylicht::CGUIElement.

◆ loadSerializable()

virtual void Skylicht::CGUIImage::loadSerializable ( CObjectSerializable * object)
virtual

Reimplemented from Skylicht::CGUIElement.

◆ render()

virtual void Skylicht::CGUIImage::render ( CCamera * camera)
virtual

Reimplemented from Skylicht::CGUIElement.


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