Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
BlamUIWidget_CoordinatesDisplay.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <thread>
4 
5 #include <Strings/components/classes/events/game_engine_events/Tick/TickEvent.h>
6 #include <Strings/components/classes/events/events.h>
8 
15 class BlamUIWidget_CoordinatesDisplay : public BlamUIWidget, public BlamEventListener
16 {
17 private:
18  BlamUIWidget_Text* text = nullptr;
19 
20  std::string display_format = "{x} {y} {z} / {yaw} {pitch} / {speed} [{mode}]";
21  std::string label_pan_cam = "pan-cam";
22  std::string label_normal_cam = "normal";
23  std::string label_uninitialized_cam = "uninitialized";
24 
25 public:
28 
29  void Draw() override;
30  void ShowImGuiPropertyEditor() override;
31  void UpdateMetrics() override;
32  void RefreshRelativePosition() override;
33 
34  void OnTickEvent(TickEvent* event) override;
35 };
Blam::Director::GetCamera
BLAM BlamDirector * GetCamera()
Retrieves the director instance.
Definition: director.cpp:31
SDLK_BACKSPACE
@ SDLK_BACKSPACE
Definition: SdlEmulationLayer.h:387
BlamUIWidget::hidden
bool hidden
Whether or not the widget is hidden.
Definition: ui.h:107
ui.h
BlamUIWidget_Console::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: BlamUIWidget_Console.cpp:172
BlamConsoleHistoryEntry::text_element
BlamUIWidget_Text * text_element
The UI widget used for displaying the message.
Definition: console.h:14
BlamConsoleHistoryEntry::visible_ticks
int visible_ticks
The amount of ticks that the message has been visible.
Definition: console.h:18
BlamConsoleHistoryEntry::BlamConsoleHistoryEntry
BlamConsoleHistoryEntry()
Definition: BlamConsoleHistoryEntry.cpp:5
Blam::Logger::LogEvent
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:130
globals
Definition: globals.h:25
BlamUIWidget_Group
Class representing a Group widget.
Definition: ui.h:263
Blam::Logger::GetLogLevelColor
BLAM BlamColor GetLogLevelColor(BlamLogLevel log_level)
Retrieves the BlamColor that a specific log level should display with.
Definition: aliases.cpp:12
BlamUIWidget::parent
BlamUIWidget_Group * parent
The parent group of this widget, if applicable.
Definition: ui.h:130
BlamConsoleHistoryEntry::creation_tick
uint64_t creation_tick
The tick when this entry was created.
Definition: console.h:13
BlamUIWidget_Console::UpdateMetrics
void UpdateMetrics() override
Updates metrics for the widget.
Definition: BlamUIWidget_Console.cpp:185
BlamUIWidget_Text::character_height
int character_height
The line height of this text widget, in pixels.
Definition: ui.h:520
BlamUIWidget_Console::~BlamUIWidget_Console
~BlamUIWidget_Console()
Definition: BlamUIWidget_Console.cpp:61
imgui.h
console.h
BlamUIWidget_Console::OnCharacterInputEvent
void OnCharacterInputEvent(CharacterInputEvent *event) override
Definition: BlamUIWidget_Console.cpp:321
BlamConsoleCommand
Class used to represent a console command.
Definition: console.h:31
BlamVersionStringDisplayMode::Console
@ Console
Indicates the build string should be formatted for the in-game console.
BlamWidgetAnchor::BottomLeft
@ BottomLeft
The widget will be placed at the bottom-left of the screen.
BlamUIWidget_Text::SetHidden
void SetHidden(bool new_hidden) override
Sets the hidden state of the widget.
Definition: text.cpp:451
SDLK_UP
@ SDLK_UP
Definition: SdlEmulationLayer.h:485
director.h
Blam::Tick::MaxTicksPerSecond
BLAM int MaxTicksPerSecond()
Retrieves the maximum number of ticks per second.
Definition: tick.cpp:208
console.h
BlamUIWidget_Console::PrintAsColumns
void PrintAsColumns(std::vector< std::string > items)
Displays a list of strings within the console column display.
Definition: BlamUIWidget_Console.cpp:646
rendering.h
BlamUIWidget_Console::BlamUIWidget_Console
BlamUIWidget_Console(BlamUIWidget_Group *_parent)
Constructs a new console widget.
Definition: BlamUIWidget_Console.cpp:16
BlamUIWidget_Text::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: text.cpp:72
BlamConsoleHistoryEntry::~BlamConsoleHistoryEntry
~BlamConsoleHistoryEntry()
Definition: BlamConsoleHistoryEntry.cpp:17
BlamDirector::vertical_angle
float vertical_angle
Definition: director.h:111
BlamUIWidget_CoordinatesDisplay::UpdateMetrics
void UpdateMetrics() override
Updates metrics for the widget.
Definition: BlamUIWidget_CoordinatesDisplay.cpp:50
BlamUIWidget_CoordinatesDisplay::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: BlamUIWidget_CoordinatesDisplay.cpp:45
BlamUIWidget_Console::RefreshRelativePosition
void RefreshRelativePosition() override
Updates the relative position of the widget, relative to its parent.
Definition: BlamUIWidget_Console.cpp:223
Blam::Globals::GetGlobalAsColor
BLAM BlamColor * GetGlobalAsColor(std::string name)
Retrieves a global's value as a BlamColor.
Definition: globals.cpp:415
BlamUIWidget::SetPosition
virtual void SetPosition(BlamVector2 new_position)
Sets the position of the widget.
Definition: BlamUIWidget.cpp:368
SDLK_RETURN
@ SDLK_RETURN
Definition: SdlEmulationLayer.h:385
BlamUIWidget_Text::UpdateMetrics
void UpdateMetrics() override
Updates metrics for the widget.
Definition: text.cpp:98
ImGui::CollapsingHeader
IMGUI_API bool CollapsingHeader(const char *label, ImGuiTreeNodeFlags flags=0)
Definition: imgui_widgets.cpp:5422
tick.h
BlamDirector::horizontal_angle
float horizontal_angle
Definition: director.h:110
BlamUIWidget_Text::Draw
void Draw() override
Draws the widget on-screen.
Definition: text.cpp:53
BlamWidgetAnchor::TopLeft
@ TopLeft
The widget will be placed at the top-left of the screen.
BlamUIWidget_Console::Draw
void Draw() override
Draws the widget on-screen.
Definition: BlamUIWidget_Console.cpp:89
BlamUIWidget::display_name
std::string display_name
The display name of the widget.
Definition: ui.h:118
Blam::Tick::GetTotalRuntimeTicks
BLAM uint64_t GetTotalRuntimeTicks()
Gets the total amount of ticks that have elapsed during program runtime.
Definition: tick.cpp:233
BlamUIWidget_Text::color
BlamColor color
The text foreground color.
Definition: ui.h:522
BlamUIWidget::SetSize
void SetSize(BlamVector2 new_size)
Sets the size of the widget.
Definition: BlamUIWidget.cpp:361
format
ARPHIC PUBLIC LICENSE Ltd Yung Chi Taiwan All rights reserved except as specified below Everyone is permitted to copy and distribute verbatim copies of this license but changing it is forbidden Preamble The licenses for most software are designed to take away your freedom to share and change it By the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software Legal Terms Font means the TrueType fonts AR PL Mingti2L AR PL KaitiM AR PL KaitiM and the derivatives of those fonts created through any modification including modifying reordering converting format
Definition: ARPHICPL.TXT:16
SDLK_RIGHT
@ SDLK_RIGHT
Definition: SdlEmulationLayer.h:482
BlamConsoleHistoryEntry::Reconfigure
void Reconfigure(BlamLogMessage _message)
Reconfigures this console history entry.
Definition: BlamConsoleHistoryEntry.cpp:23
BlamConsoleHistoryEntry::opacity
byte opacity
The opacity of the message text.
Definition: console.h:15
BlamEngineGlobal
Structure containing data for a game engine global.
Definition: globals.h:54
BlamUIWidget_CoordinatesDisplay::Draw
void Draw() override
Draws the widget on-screen.
Definition: BlamUIWidget_CoordinatesDisplay.cpp:39
BlamDirector::speed
float speed
The camera's current speed.
Definition: director.h:94
globals.h
BlamUIWidget_Console::ClearOutput
void ClearOutput()
Clears the console output.
Definition: BlamUIWidget_Console.cpp:735
it
ARPHIC PUBLIC LICENSE Ltd Yung Chi Taiwan All rights reserved except as specified below Everyone is permitted to copy and distribute verbatim copies of this license but changing it is forbidden Preamble The licenses for most software are designed to take away your freedom to share and change it By the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software Legal Terms Font means the TrueType fonts AR PL Mingti2L AR PL KaitiM AR PL KaitiM and the derivatives of those fonts created through any modification including modifying reordering converting changing font or adding deleting some characters in from glyph table PL means Public License Copyright Holder means whoever is named in the copyright or copyrights for the Font You means the or person redistributing or modifying the Font Freely Available means that you have the freedom to copy or modify the Font as well as redistribute copies of the Font under the same conditions you not price If you you can charge for this service Copying &Distribution You may copy and distribute verbatim copies of this Font in any without provided that you retain this license including modifying reordering converting changing font or adding deleting some characters in from glyph and copy and distribute such modifications under the terms of Section provided that the following conditions are such as by offering access to copy the modifications from a designated or distributing the modifications on a medium customarily used for software interchange c If the modified fonts normally reads commands interactively when you must cause it
Definition: ARPHICPL.TXT:36
Blam::Resources::Console::GetCommandList
BLAM std::map< std::string, BlamConsoleCommand * > GetCommandList()
Retrieves the list of all loaded console commands.
Definition: console.cpp:228
BlamDirector
Class representing the Director.
Definition: director.h:27
BlamUIWidget
Base class for a UI widget.
Definition: ui.h:87
SDLK_LEFT
@ SDLK_LEFT
Definition: SdlEmulationLayer.h:483
Blam::Resources::Console::RunCommandLine
BLAM BlamResult RunCommandLine(std::string command_line)
Executed the provided string as a console command.
Definition: console.cpp:260
SDLK_DOWN
@ SDLK_DOWN
Definition: SdlEmulationLayer.h:484
BlamUIWidget_CoordinatesDisplay::BlamUIWidget_CoordinatesDisplay
BlamUIWidget_CoordinatesDisplay(BlamUIWidget_Group *_parent)
Definition: BlamUIWidget_CoordinatesDisplay.cpp:12
BlamWidgetType::CoordinatesDisplay
@ CoordinatesDisplay
Special widget. Used for the coordinates display.
BlamUIWidget_Text::text
std::string text
The text to display within this text widget.
Definition: ui.h:526
BlamConsoleHistoryEntry::Deconfigure
void Deconfigure()
Deconfigures this console history entry.
Definition: BlamConsoleHistoryEntry.cpp:36
BlamUIWidget::RefreshRelativePosition
virtual void RefreshRelativePosition()
Updates the relative position of the widget, relative to its parent.
Definition: BlamUIWidget.cpp:212
BlamUIWidget::description
std::string description
An optional description of the widget.
Definition: ui.h:119
SDLK_TAB
@ SDLK_TAB
Definition: SdlEmulationLayer.h:388
x
config GlyphExtraSpacing x
Definition: README.txt:30
BlamUIWidget_Text::shadow_color
BlamColor shadow_color
The text shadow color.
Definition: ui.h:523
BlamUIWidget::IsHidden
bool IsHidden()
Checks whether or not the widget is hidden.
Definition: BlamUIWidget.cpp:420
BlamUIWidget_Console::OnLogMessageEvent
void OnLogMessageEvent(LogMessageEvent *event) override
Definition: BlamUIWidget_Console.cpp:418
Blam::Logger::LogEventForce
BLAM void LogEventForce(std::string message)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:262
BlamUIWidget_CoordinatesDisplay
Class used for the coordinates display UI.
Definition: BlamUIWidget_CoordinatesDisplay.h:15
BlamConsoleHistoryEntry
Class representing a console history entry.
Definition: console.h:10
BlamWidgetType
BlamWidgetType
Enumerator listing possible UI widget types.
Definition: ui.h:60
BlamUIWidget_CoordinatesDisplay.h
BlamUIWidget::auto_update
bool auto_update
Whether or not the widget should always update every frame.
Definition: ui.h:127
BlamDirector::pancam
bool pancam
Whether or not the camera is currently in pan-cam mode. Pan-cam locks Z movement of the camera when n...
Definition: director.h:97
BlamUIWidget_CoordinatesDisplay::~BlamUIWidget_CoordinatesDisplay
~BlamUIWidget_CoordinatesDisplay()
Definition: BlamUIWidget_CoordinatesDisplay.cpp:33
BlamUIWidget_CoordinatesDisplay::OnTickEvent
void OnTickEvent(TickEvent *event) override
Definition: BlamUIWidget_CoordinatesDisplay.cpp:64
BlamUIWidget_Console::OnTickEvent
void OnTickEvent(TickEvent *event) override
Definition: BlamUIWidget_Console.cpp:351
BlamUIWidget_CoordinatesDisplay::RefreshRelativePosition
void RefreshRelativePosition() override
Updates the relative position of the widget, relative to its parent.
Definition: BlamUIWidget_CoordinatesDisplay.cpp:59
BlamDirector::camera_pos
BlamVector3 camera_pos
The current position of the camera.
Definition: director.h:80
Blam::Globals::GetGlobalAsBoolean
BLAM bool * GetGlobalAsBoolean(std::string name)
Retrieves a global's value as a boolean.
Definition: globals.cpp:343
BlamConsoleHistoryEntry::message
BlamLogMessage message
The message that this entry is displaying.
Definition: console.h:16
BlamUIWidget_Text
Class representing a Text widget.
Definition: ui.h:483
name
ARPHIC PUBLIC LICENSE Ltd Yung Chi Taiwan All rights reserved except as specified below Everyone is permitted to copy and distribute verbatim copies of this license but changing it is forbidden Preamble The licenses for most software are designed to take away your freedom to share and change it By the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software Legal Terms Font means the TrueType fonts AR PL Mingti2L AR PL KaitiM AR PL KaitiM and the derivatives of those fonts created through any modification including modifying reordering converting changing font name
Definition: ARPHICPL.TXT:16
BlamUIWidget_Console::OnKeyPressEvent
void OnKeyPressEvent(KeyPressEvent *event) override
Definition: BlamUIWidget_Console.cpp:241
Blam::Globals::GetGlobalsList
BLAM std::map< std::string, BlamEngineGlobal > * GetGlobalsList()
Retrieves the list of loaded globals.
Definition: globals.cpp:22
BlamUIWidget::SetAnchorPosition
void SetAnchorPosition(BlamWidgetAnchor new_anchor_position)
Sets the anchor position of the widget.
Definition: BlamUIWidget.cpp:381
Blam::Rendering::GetRenderWidth
BLAM int GetRenderWidth()
Retrieves the current width of the OGRE viewport.
Definition: ogre.cpp:363