 |
Blamite Game Engine - blam!
00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
|
Go to the documentation of this file.
3 #include <Strings/components/resources/color/BlamColor.h>
4 #include <OGRE/Overlay/OgreTextAreaOverlayElement.h>
5 #include <OGRE/Overlay/OgreOverlayContainer.h>
6 #include <OGRE/Overlay/OgrePanelOverlayElement.h>
7 #include <OGRE/Overlay/OgreOverlay.h>
8 #include <OGRE/OgreManualObject2.h>
9 #include <OGRE/OgreSceneManager.h>
101 void ShowAnchorChangeButton(
BlamWidgetAnchor new_anchor,
int height_mul,
int width_mul,
bool text_multiline);
122 BlamVector2
size = { 100, 100 };
198 void SetSize(BlamVector2 new_size);
205 virtual void SetPosition(BlamVector2 new_position);
270 std::vector<BlamUIWidget*>
children = std::vector<BlamUIWidget*>();
289 void Draw()
override;
293 void SetHidden(
bool new_hidden)
override;
316 int cached_child_count = 0;
326 void Draw()
override;
346 void PreGenerateManualObject();
354 void PostGenerateManualObject();
361 void VerifyManualObjectValid();
366 Ogre::SceneNode*
node =
nullptr;
371 BlamColor
color = BlamColor(255, 255, 255);
382 void Draw()
override;
385 void SetHidden(
bool new_hidden)
override;
443 BlamVector2
end = { 0, 0 };
460 void GenerateManualObject()
override;
486 Ogre::SceneNode* node =
nullptr;
487 Ogre::ManualObject* manual_object =
nullptr;
489 std::string previous_text =
"";
490 bool last_hide_state =
false;
491 BlamColor last_color = BlamColor(255, 255, 255);
492 BlamColor last_shadow_color = BlamColor(0, 0, 0);
494 std::vector<Ogre::HlmsDatablock*> datablocks = std::vector<Ogre::HlmsDatablock*>();
495 std::vector<Ogre::HlmsDatablock*> shadow_datablocks = std::vector<Ogre::HlmsDatablock*>();
496 bool needs_new_datablocks =
true;
501 void ReleaseOldDatablocks();
506 void GenerateManualObject();
516 void GenerateManualObjectSection(
bool is_shadow);
522 BlamColor
color = BlamColor(255, 255, 255);
531 void Draw()
override;
534 void SetHidden(
bool new_hidden)
override;
@ DebugMenu
Special widget. Used for the in-game debug menu.
@ BottomFill
The widget will fill the bottom of the screen, while height is left unchanged.
@ CenterRight
The widget will be placed at the center-right of the screen.
@ Center
The widget will be placed at the center of the screen.
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:130
std::string font_name
The name of the font package to use for this text widget.
Definition: ui.h:524
BlamWidgetAnchor
Enumerator listing possible widget anchor positions.
Definition: ui.h:32
BLAM std::string GetWidgetAnchorLabel(BlamWidgetAnchor anchor_position)
Retrieves a string representation of a widget anchor position.
Definition: ui.cpp:69
IMGUI_API bool Checkbox(const char *label, bool *v)
Definition: imgui_widgets.cpp:974
BLAM BlamUIWidget_Group * GetUIRoot()
Retrieves the root UI group widget.
Definition: ui.cpp:64
Class representing a Blamite font package.
Definition: fonts.h:86
BlamFontPackage * font_package
The font package being used for this text widget.
Definition: ui.h:525
int character_height
The line height of this text widget, in pixels.
Definition: ui.h:520
BlamVector2 shadow_offset
The offset of the text shadow, in pixels.
Definition: ui.h:521
@ Text
A text object, used to show text on-screen.
@ Basic_Rectangle
A basic filled or outline rectangle.
@ Basic_Ellipse
A basic filled or outline ellipse.
IMGUI_API bool InputText(const char *label, char *buf, size_t buf_size, ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
Definition: imgui_widgets.cpp:3068
@ Console
Indicates the build string should be formatted for the in-game console.
@ BottomLeft
The widget will be placed at the bottom-left of the screen.
@ Group_VLayout
A group widget which displays all items in a vertical list.
BLAM float * GetGlobalAsFloat(std::string name)
Retrieves a global's value as a float.
Definition: globals.cpp:403
Definition: cui_screen.h:42
unsigned char uint8_t
Definition: stdint.h:15
BLAM BlamUIWidget_DebugMenu * GetDebugMenuWidget()
Retrieves the built-in debug menu widget.
Definition: ui.cpp:295
void SetHidden(bool new_hidden) override
Sets the hidden state of the widget.
Definition: text.cpp:451
@ BottomRight
The widget will be placed at the bottom-right of the screen.
BLAM BlamUIWidget_CrashScreen * GetCrashScreenWidget()
Retrieves the built-in crash screen widget.
Definition: ui.cpp:277
@ CenterLeft
The widget will be placed at the center-left of the screen.
IMGUI_API bool DragInt(const char *label, int *v, float v_speed=1.0f, int v_min=0, int v_max=0, const char *format="%d")
Definition: imgui_widgets.cpp:2209
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: text.cpp:72
IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f)
Definition: imgui.cpp:7147
@ TopCenter
The widget will be placed at the top-center of the screen.
@ BottomCenter
The widget will be placed at the bottom-center of the screen.
BLAM bool LoadFromCUIScreenTag(std::string tag_path, cui_screen *cusc_tag)
Creates a new UI widget from a cui_screen tag.
Definition: ui.cpp:134
@ RightFill
The widget will fill the right of the screen, while width is left unchanged.
@ UIDCypher
Special widget. Used for the user ID cypher.
Namespace containing functions relating to the Blamite UI system.
Definition: ui.h:548
~BlamUIWidget_Text()
Definition: text.cpp:36
IMGUI_API bool DragFloat(const char *label, float *v, float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", float power=1.0f)
Definition: imgui_widgets.cpp:2164
void UpdateMetrics() override
Updates metrics for the widget.
Definition: text.cpp:98
IMGUI_API bool DragFloat2(const char *label, float v[2], float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", float power=1.0f)
Definition: imgui_widgets.cpp:2169
IMGUI_API bool CollapsingHeader(const char *label, ImGuiTreeNodeFlags flags=0)
Definition: imgui_widgets.cpp:5422
Class for the Blam UI Editor debug utility.
Definition: blam_ui_editor.hpp:11
void Draw() override
Draws the widget on-screen.
Definition: text.cpp:53
@ TopLeft
The widget will be placed at the top-left of the screen.
BlamColor color
The text foreground color.
Definition: ui.h:522
BLAM void Render()
Renders all UI to the screen.
Definition: ui.cpp:41
@ DebugMenuItem
Special widget. Represents an item within the debug menu.
BLAM void Shutdown()
Shuts down the UI system.
Definition: ui.cpp:55
@ TopFill
The widget will fill the top of the screen, while height is left unchanged.
IMGUI_API bool BeginCombo(const char *label, const char *preview_value, ImGuiComboFlags flags=0)
Definition: imgui_widgets.cpp:1416
@ CrashScreen
Indicates the build string should be formatted for the crash screen.
Definition: material.h:52
@ CrashScreen
Special widget. Used for the in-game crash screen.
@ Basic_Triangle
A basic filled or outline triangle.
Ogre::HlmsDatablock * instance_datablock
The datablock used for this material instance.
Definition: rendering.h:36
Data structure used to store OGRE material instance data.
Definition: rendering.h:32
BlamUIWidget_Text(BlamUIWidget_Group *_parent)
Definition: text.cpp:30
@ Group_HLayout
A group widget which displays all items in a horizontal list.
BLAM int GetRenderHeight()
Retrieves the current height of the OGRE viewport.
Definition: ogre.cpp:368
#define BLAM
Definition: ui.h:18
IMGUI_API bool InputTextMultiline(const char *label, char *buf, size_t buf_size, const ImVec2 &size=ImVec2(0, 0), ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
Definition: imgui_widgets.cpp:3074
IMGUI_API void EndCombo()
Definition: imgui_widgets.cpp:1522
BlamUIWidget_Group * ui_root
The UI root widget.
Definition: ui.cpp:13
@ CoordinatesDisplay
Special widget. Used for the coordinates display.
@ Fill
The widget will fill the entire screen.
std::string text
The text to display within this text widget.
Definition: ui.h:526
@ Group
A group widget, which can be used to contain any number of other widgets.
bool draw_fail_message_shown
Whether or not the "draw failure" message has been displayed. Used to prevent spamming the log if the...
Definition: ui.cpp:14
BlamColor shadow_color
The text shadow color.
Definition: ui.h:523
@ FramerateDisplay
Special widget. Used for the framerate display.
@ Basic_Line
A basic line.
IMGUI_API void Separator()
Definition: imgui_widgets.cpp:1284
BlamWidgetType
Enumerator listing possible UI widget types.
Definition: ui.h:60
BLAM bool Initialize()
Initializes the UI system.
Definition: ui.cpp:16
BLAM Ogre::HlmsDatablock * GetDatablockFromTag(std::string tag_path)
Retrieves an OGRE datablock from a material tag path.
Definition: materials.cpp:884
void RebuildTextObject()
Regenerates the text object.
Definition: text.cpp:181
BLAM ogre_material_instance_data * GetDatablockInstanceFromTag(std::string tag_path, std::string referencing_tag_path)
Retrieves a datablock instance from a material tag path, and a referencing tag path.
Definition: materials.cpp:896
bool auto_scale_shadow
Whether or not to automatically scale the text shadow based on text size.
Definition: ui.h:519
@ LeftFill
The widget will fill the left of the screen, while width is left unchanged.
@ Unspecified
Indicates the widget is of an unspecified type. Will only appear when a widget is improperly construc...
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0))
Definition: imgui_widgets.cpp:644
@ TopRight
The widget will be placed at the top-right of the screen.
Class representing a Text widget.
Definition: ui.h:483
BLAM int * GetGlobalAsInteger(std::string name)
Retrieves a global's value as an int.
Definition: globals.cpp:391
BLAM int GetRenderWidth()
Retrieves the current width of the OGRE viewport.
Definition: ogre.cpp:363