Shkyera Engine
Easy to use, game engine for Python
shkyera::ScriptUIComponent Class Reference

A class representing a user interface component for interacting with scripts. More...

#include <ScriptUIComponent.hpp>

Inheritance diagram for shkyera::ScriptUIComponent:
[legend]

Private Member Functions

virtual void draw () override
 Implementation of the abstract draw method to render the UI for this component. More...
 
void replaceScript (std::filesystem::path path)
 Replace the current script with a new one from the specified file path. More...
 
void drawScriptFile ()
 Draw the script file and its contents in the UI. More...
 
void drawVariables ()
 Draw the script variables in the UI. More...
 
void drawFloatVariable (PublicFloat &variable)
 Draw a float variable in the UI. More...
 
void drawIntVariable (PublicInt &variable)
 Draw an integer variable in the UI. More...
 
void drawStringVariable (PublicString &variable)
 Draw a string variable in the UI. More...
 
void drawVec3Variable (PublicVec3 &variable)
 Draw a glm::vec3 variable in the UI. More...
 
 UIComponent (std::string name, std::shared_ptr< GameObject > object)
 Constructor to create a UI component with a specified name and associated game object. More...
 

Private Attributes

std::shared_ptr< ScriptComponent_script
 A shared pointer to the associated script component. More...
 

Static Private Attributes

static constexpr float LABEL_MARGIN = 120.0f
 The margin used for labeling elements in the UI. More...
 

Additional Inherited Members

- Public Member Functions inherited from shkyera::UIComponent
 UIComponent (std::string name, std::shared_ptr< GameObject > object)
 Constructor to create a UI component with a specified name and associated game object. More...
 
- Static Public Member Functions inherited from shkyera::UIComponent
static void addComponentToObject (std::shared_ptr< GameObject > object, std::shared_ptr< UIComponent > component)
 Static method to add a UI component to a game object. More...
 
static std::vector< std::shared_ptr< UIComponent > > getComponentsOfObject (std::shared_ptr< GameObject > object)
 Static method to retrieve a list of UI components associated with a game object. More...
 
- Protected Attributes inherited from shkyera::UIComponent
uint64_t _uuid
 A unique identifier for the UI component. More...
 
std::string _name
 The name of the UI component. More...
 
std::shared_ptr< GameObject_object
 The game object associated with the UI component. More...
 

Detailed Description

A class representing a user interface component for interacting with scripts.

The ScriptUIComponent class is a specialized UI component used to display and manage script-related information, including script files and their associated variables.

Member Function Documentation

◆ draw()

void shkyera::ScriptUIComponent::draw ( )
overrideprivatevirtual

Implementation of the abstract draw method to render the UI for this component.

Implements shkyera::UIComponent.

◆ drawFloatVariable()

void shkyera::ScriptUIComponent::drawFloatVariable ( PublicFloat variable)
private

Draw a float variable in the UI.

Parameters
variableThe float variable to render.

◆ drawIntVariable()

void shkyera::ScriptUIComponent::drawIntVariable ( PublicInt variable)
private

Draw an integer variable in the UI.

Parameters
variableThe integer variable to render.

◆ drawScriptFile()

void shkyera::ScriptUIComponent::drawScriptFile ( )
private

Draw the script file and its contents in the UI.

◆ drawStringVariable()

void shkyera::ScriptUIComponent::drawStringVariable ( PublicString variable)
private

Draw a string variable in the UI.

Parameters
variableThe string variable to render.

◆ drawVariables()

void shkyera::ScriptUIComponent::drawVariables ( )
private

Draw the script variables in the UI.

◆ drawVec3Variable()

void shkyera::ScriptUIComponent::drawVec3Variable ( PublicVec3 variable)
private

Draw a glm::vec3 variable in the UI.

Parameters
variableThe glm::vec3 variable to render.

◆ replaceScript()

void shkyera::ScriptUIComponent::replaceScript ( std::filesystem::path  path)
private

Replace the current script with a new one from the specified file path.

Parameters
pathThe path to the new script file.

◆ UIComponent()

shkyera::UIComponent::UIComponent
private

Constructor to create a UI component with a specified name and associated game object.

Parameters
nameThe name of the UI component.
objectA shared pointer to the game object associated with the UI component.

Member Data Documentation

◆ _script

std::shared_ptr<ScriptComponent> shkyera::ScriptUIComponent::_script
private

A shared pointer to the associated script component.

◆ LABEL_MARGIN

constexpr float shkyera::ScriptUIComponent::LABEL_MARGIN = 120.0f
staticconstexprprivate

The margin used for labeling elements in the UI.


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