 |
Blamite Game Engine - blam!
00423.10.27.24.0533.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>
103 void ShowAnchorChangeButton(
BlamWidgetAnchor new_anchor,
int height_mul,
int width_mul,
bool text_multiline);
124 BlamVector2
size = { 100, 100 };
200 void SetSize(BlamVector2 new_size);
207 virtual void SetPosition(BlamVector2 new_position);
272 std::vector<BlamUIWidget*>
children = std::vector<BlamUIWidget*>();
291 void Draw()
override;
295 void SetHidden(
bool new_hidden)
override;
318 int cached_child_count = 0;
328 void Draw()
override;
348 void PreGenerateManualObject();
356 void PostGenerateManualObject();
363 void VerifyManualObjectValid();
368 Ogre::SceneNode*
node =
nullptr;
373 BlamColor
color = BlamColor(255, 255, 255);
384 void Draw()
override;
387 void SetHidden(
bool new_hidden)
override;
445 BlamVector2
end = { 0, 0 };
462 void GenerateManualObject()
override;
488 Ogre::SceneNode* node =
nullptr;
489 Ogre::ManualObject* manual_object =
nullptr;
491 std::string previous_text =
"";
492 bool last_hide_state =
false;
493 BlamColor last_color = BlamColor(255, 255, 255);
494 BlamColor last_shadow_color = BlamColor(0, 0, 0);
496 std::vector<Ogre::HlmsDatablock*> datablocks = std::vector<Ogre::HlmsDatablock*>();
497 std::vector<Ogre::HlmsDatablock*> shadow_datablocks = std::vector<Ogre::HlmsDatablock*>();
498 bool needs_new_datablocks =
true;
503 void ReleaseOldDatablocks();
508 void GenerateManualObject();
518 void GenerateManualObjectSection(
bool is_shadow);
524 BlamColor
color = BlamColor(255, 255, 255);
533 void Draw()
override;
536 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:526
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:71
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:66
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:527
int character_height
The line height of this text widget, in pixels.
Definition: ui.h:522
BlamVector2 shadow_offset
The offset of the text shadow, in pixels.
Definition: ui.h:523
@ 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:297
void SetHidden(bool new_hidden) override
Sets the hidden state of the widget.
Definition: text.cpp:452
@ 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:279
@ 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:71
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:136
@ 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:550
~BlamUIWidget_Text()
Definition: text.cpp:35
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:97
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:52
@ TopLeft
The widget will be placed at the top-left of the screen.
BlamColor color
The text foreground color.
Definition: ui.h:524
BLAM void Render()
Renders all UI to the screen.
Definition: ui.cpp:43
@ DebugMenuItem
Special widget. Represents an item within the debug menu.
BLAM void Shutdown()
Shuts down the UI system.
Definition: ui.cpp:57
@ 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:44
Data structure used to store OGRE material instance data.
Definition: rendering.h:40
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:532
#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:14
@ 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:528
@ 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:15
BlamColor shadow_color
The text shadow color.
Definition: ui.h:525
@ FramerateDisplay
Special widget. Used for the framerate display.
@ Basic_Line
A basic line.
@ DebugText3D
Special widget. Used for generic 3D debug text.
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:17
BLAM Ogre::HlmsDatablock * GetDatablockFromTag(std::string tag_path)
Retrieves an OGRE datablock from a material tag path.
Definition: materials.cpp:915
void RebuildTextObject()
Regenerates the text object.
Definition: text.cpp:180
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:927
bool auto_scale_shadow
Whether or not to automatically scale the text shadow based on text size.
Definition: ui.h:521
@ 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:485
@ DebugText2D
Special widget. Used for generic 2D debug text.
Class used for 3D debug text.
Definition: BlamUIWidget_DebugText3D.h:14
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:527