Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::Particle::CGUIParticle Class Reference

2D GUI element that displays a 3D particle system. More...

#include <ParticleSystem/CGUIParticle.h>

Inheritance diagram for Skylicht::Particle::CGUIParticle:
Skylicht::CGUIElement

Public Member Functions

 CGUIParticle (CCanvas *canvas, CGUIElement *parent)
 Constructor.
 CGUIParticle (CCanvas *canvas, CGUIElement *parent, const core::rectf &rect)
 Constructor with a predefined rectangle.
virtual void update (CCamera *camera)
 Updates the particle system animations.
virtual void render (CCamera *camera)
 Renders the particle system into the 2D canvas.
virtual CObjectSerializablecreateSerializable ()
 Creates a serializable object for property editing.
virtual void loadSerializable (CObjectSerializable *object)
 Loads properties from a serializable object.
void setParticle (const char *source, bool autoPlay)
 Sets the particle system source file.
void playParticle ()
 Starts playback of the particle system.
void stopParticle ()
 Stops playback and clears existing particles.
void reload ()
 Reloads the particle system from the current source path.
Particle::CParticleComponentgetParticle ()
 Returns the underlying particle component.
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 ()
virtual const core::rectf getNativeRect ()
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 ()
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 ()

Static Public Member Functions

static void registerPlugin ()
 Registers the CGUIParticle class to the CGUIFactory.

Protected Member Functions

void renderParticleBuffer (Particle::CGroup *g)
 Renders a specific particle group.
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

std::string m_source
 The source path to the .particle file.
bool m_autoPlay
 Whether the particle system plays automatically upon loading.
float m_particleScale
 Scaling factor for the 3D particle system in 2D UI space.
float m_depthZ
 Depth value (Z) for rendering the particle system relative to the UI.
Particle::CParticleComponentm_ps
 The underlying particle component instance.
core::vector3df m_billboardUp
 Cached up vector for billboarding.
core::vector3df m_billboardLook
 Cached look vector for billboarding.
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

Additional Inherited Members

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

Detailed Description

2D GUI element that displays a 3D particle system.

Allows particle effects to be used within the UI canvas.

Example

// You need to register the plugin first (e.g., in CApplication::initPlugin)
// CGUIParticle::registerPlugin();
// Then create a GUI particle element via factory
CGUIParticle *guiParticle = (CGUIParticle*)CGUIFactory::getInstance()->createGUI("CGUIParticle", parent);
guiParticle->setParticle("Particles/Magic.particle", true);
guiParticle->playParticle();
void setParticle(const char *source, bool autoPlay)
Sets the particle system source file.
void playParticle()
Starts playback of the particle system.
CGUIParticle(CCanvas *canvas, CGUIElement *parent)
Constructor.

Constructor & Destructor Documentation

◆ CGUIParticle() [1/2]

Skylicht::Particle::CGUIParticle::CGUIParticle ( CCanvas * canvas,
CGUIElement * parent )

Constructor.

Parameters
canvasThe parent canvas.
parentThe parent GUI element.

◆ CGUIParticle() [2/2]

Skylicht::Particle::CGUIParticle::CGUIParticle ( CCanvas * canvas,
CGUIElement * parent,
const core::rectf & rect )

Constructor with a predefined rectangle.

Parameters
canvasThe parent canvas.
parentThe parent GUI element.
rectThe element's rectangle.

Member Function Documentation

◆ createSerializable()

virtual CObjectSerializable * Skylicht::Particle::CGUIParticle::createSerializable ( )
virtual

Creates a serializable object for property editing.

Returns
A new CObjectSerializable instance.

Reimplemented from Skylicht::CGUIElement.

◆ getParticle()

Particle::CParticleComponent * Skylicht::Particle::CGUIParticle::getParticle ( )
inline

Returns the underlying particle component.

Returns
Pointer to CParticleComponent.

◆ loadSerializable()

virtual void Skylicht::Particle::CGUIParticle::loadSerializable ( CObjectSerializable * object)
virtual

Loads properties from a serializable object.

Parameters
objectThe serializable data.

Reimplemented from Skylicht::CGUIElement.

◆ render()

virtual void Skylicht::Particle::CGUIParticle::render ( CCamera * camera)
virtual

Renders the particle system into the 2D canvas.

Parameters
cameraThe current rendering camera.

Reimplemented from Skylicht::CGUIElement.

◆ renderParticleBuffer()

void Skylicht::Particle::CGUIParticle::renderParticleBuffer ( Particle::CGroup * g)
protected

Renders a specific particle group.

Parameters
gThe particle group to render.

◆ setParticle()

void Skylicht::Particle::CGUIParticle::setParticle ( const char * source,
bool autoPlay )

Sets the particle system source file.

Parameters
sourcePath to the .particle file.
autoPlayIf true, starts playing immediately.

◆ update()

virtual void Skylicht::Particle::CGUIParticle::update ( CCamera * camera)
virtual

Updates the particle system animations.

Parameters
cameraThe current rendering camera.

Reimplemented from Skylicht::CGUIElement.


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