Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
BlamUIWidget_Console Class Reference

Class for the console UI widget. More...

#include <console.h>

+ Inheritance diagram for BlamUIWidget_Console:
+ Collaboration diagram for BlamUIWidget_Console:

Public Member Functions

 BlamUIWidget_Console (BlamUIWidget_Group *_parent)
 Constructs a new console widget. More...
 
 ~BlamUIWidget_Console ()
 
void Draw () override
 Draws the widget on-screen. More...
 
void ShowImGuiPropertyEditor () override
 Displays an ImGUI-based property editor. More...
 
void UpdateMetrics () override
 Updates metrics for the widget. More...
 
void RefreshRelativePosition () override
 Updates the relative position of the widget, relative to its parent. More...
 
void OnKeyPressEvent (KeyPressEvent *event) override
 
void OnCharacterInputEvent (CharacterInputEvent *event) override
 
void OnTickEvent (TickEvent *event) override
 
void OnLogMessageEvent (LogMessageEvent *event) override
 
void PrintAsColumns (std::vector< std::string > items)
 Displays a list of strings within the console column display. More...
 
void PrintAsColumns (std::vector< BlamLogMessage > items)
 Displays a list of log messages within the console column display. More...
 
void ClearOutput ()
 Clears the console output. More...
 
- Public Member Functions inherited from BlamUIWidget
 BlamUIWidget (BlamWidgetType type)
 Constructs a new UI widget. More...
 
 BlamUIWidget (BlamWidgetType type, BlamUIWidget_Group *_parent)
 Constructs a new UI widget. More...
 
virtual ~BlamUIWidget ()
 
BlamWidgetType GetType ()
 Retrieves the type of this widget. More...
 
void RefreshRelativePosition (int viewport_width, int viewport_height, BlamVector2 initial_position)
 Updates the relative position of the widget. More...
 
void SetSize (BlamVector2 new_size)
 Sets the size of the widget. More...
 
virtual void SetPosition (BlamVector2 new_position)
 Sets the position of the widget. More...
 
void SetRotation (float new_rotation)
 Sets the rotation of the widget. More...
 
void SetAnchorPosition (BlamWidgetAnchor new_anchor_position)
 Sets the anchor position of the widget. More...
 
void MarkForUpdate ()
 Marks the widget as needing to be updated on the next draw call. More...
 
BlamVector2 GetAbsolutePosition ()
 Retrieves the absolute position of the widget. More...
 
BlamWidgetAnchor GetAnchorPosition ()
 Retrieves the anchor position of the widget. More...
 
virtual void SetHidden (bool new_hidden)
 Sets the hidden state of the widget. More...
 
bool IsHidden ()
 Checks whether or not the widget is hidden. More...
 

Additional Inherited Members

- Public Attributes inherited from BlamUIWidget
std::string display_name = "unnamed"
 The display name of the widget. More...
 
std::string description = ""
 An optional description of the widget. More...
 
BlamVector2 position = { 0, 0 }
 The position of the widget, relative to its parent. More...
 
BlamVector2 size = { 100, 100 }
 The size of the widget, relative to its parent. More...
 
float rotation = 0.0f
 The rotation of the widget, in degrees. More...
 
int z_index = 0
 The Z index of the widget, where higher Z orders are drawn on top. More...
 
float z_size = 1.0f
 The Z size of the widget. Mostly unused. More...
 
bool auto_update = false
 Whether or not the widget should always update every frame. More...
 
Ogre::HlmsDatablock * material = nullptr
 The datablock used by the widget, if applicable. More...
 
BlamUIWidget_Groupparent = nullptr
 The parent group of this widget, if applicable. More...
 
bool ignore_layout = false
 Whether or not this widget should ignore any layout positioning. More...
 
bool hide_in_layout = false
 Whether or not this widget should be hidden within its layout. More...
 
bool ignore_scale_factor = false
 Whether or not this widget should ignore the UI scale factor settings. More...
 
- Protected Member Functions inherited from BlamUIWidget
int GetAdjustedZIndex ()
 Retrieves the adjusted Z-index of the widget. More...
 
- Protected Attributes inherited from BlamUIWidget
BlamVector2 position_absolute = { 0, 0 }
 The absolute position of the widget on-screen. More...
 
BlamVector2 size_absolute = { 100, 100 }
 The absolute size of the widget on-screen. More...
 
bool update = false
 Whether or not the widget needs to be updated before the next draw call. More...
 
bool hidden = false
 Whether or not the widget is hidden. More...
 

Detailed Description

Class for the console UI widget.

The console allows for direct interaction with the engine through console commands. Additionally, it allows for direct execution of script functions and modification of script variables.

Constructor & Destructor Documentation

◆ BlamUIWidget_Console()

BlamUIWidget_Console::BlamUIWidget_Console ( BlamUIWidget_Group _parent)

Constructs a new console widget.

Parameters
_parent- The parent of this widget. Should always be the UI root.
+ Here is the call graph for this function:

◆ ~BlamUIWidget_Console()

BlamUIWidget_Console::~BlamUIWidget_Console ( )

Member Function Documentation

◆ ClearOutput()

void BlamUIWidget_Console::ClearOutput ( )

Clears the console output.

Will clear both log message history as well as column content.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Draw()

void BlamUIWidget_Console::Draw ( )
overridevirtual

Draws the widget on-screen.

Reimplemented from BlamUIWidget.

+ Here is the call graph for this function:

◆ OnCharacterInputEvent()

void BlamUIWidget_Console::OnCharacterInputEvent ( CharacterInputEvent *  event)
override

◆ OnKeyPressEvent()

void BlamUIWidget_Console::OnKeyPressEvent ( KeyPressEvent *  event)
override
+ Here is the call graph for this function:

◆ OnLogMessageEvent()

void BlamUIWidget_Console::OnLogMessageEvent ( LogMessageEvent *  event)
override
+ Here is the call graph for this function:

◆ OnTickEvent()

void BlamUIWidget_Console::OnTickEvent ( TickEvent *  event)
override
+ Here is the call graph for this function:

◆ PrintAsColumns() [1/2]

void BlamUIWidget_Console::PrintAsColumns ( std::vector< BlamLogMessage >  items)

Displays a list of log messages within the console column display.

Each item will be displayed from the top-left to the bottom-right, occupying as many rows as needed to display all items unless the amount of items exceeds the number of rows - in which case as many items will be shown, and the remainder will not be displayed. The amount of items that can be shown depeneds on the amount of console lines and the maximum amount of columns.

This method can be used to display messages with color information. No other log message information is used.

Parameters
items- The items to display within the columns.
+ Here is the call graph for this function:

◆ PrintAsColumns() [2/2]

void BlamUIWidget_Console::PrintAsColumns ( std::vector< std::string >  items)

Displays a list of strings within the console column display.

Each item will be displayed from the top-left to the bottom-right, occupying as many rows as needed to display all items unless the amount of items exceeds the number of rows - in which case as many items will be shown, and the remainder will not be displayed. The amount of items that can be shown depeneds on the amount of console lines and the maximum amount of columns.

Parameters
items- The items to display within the columns.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RefreshRelativePosition()

void BlamUIWidget_Console::RefreshRelativePosition ( )
overridevirtual

Updates the relative position of the widget, relative to its parent.

If the widget has no parent, then it will refresh relative to the viewport instead.

Reimplemented from BlamUIWidget.

+ Here is the call graph for this function:

◆ ShowImGuiPropertyEditor()

void BlamUIWidget_Console::ShowImGuiPropertyEditor ( )
overridevirtual

Displays an ImGUI-based property editor.

Used in conjunction with the UI Editor window.

Reimplemented from BlamUIWidget.

+ Here is the call graph for this function:

◆ UpdateMetrics()

void BlamUIWidget_Console::UpdateMetrics ( )
overridevirtual

Updates metrics for the widget.

The term "metrics" as used in this method is generally up to an individual widget class to decide. However, in most cases, it will include position, size, rotation, and color.

Reimplemented from BlamUIWidget.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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