![]() |
Blamite Game Engine - Blam (Core)
|
Base class for all render stack objects. More...
#include <render_stack.h>
Public Member Functions | |
StackObjectBase () | |
Sets default values and provides a default ID to be used if none is provided. More... | |
~StackObjectBase () | |
Empty destructor. More... | |
virtual void | Draw () |
Draws the stack object. More... | |
virtual void | ShowImPropertyEditor () |
Shows a set of ImGUI properties associated with the object. More... | |
virtual void | HandleResize () |
Called upon window resize events. More... | |
void | SetArea (float new_area[4]) |
Sets the area of the object. More... | |
void | SetArea (float top, float bottom, float left, float right) |
Sets the area of the object. More... | |
void | SetArea (D2D1_RECT_F new_area) |
Sets the area of the object. More... | |
void | SetColor (float new_color[3]) |
Sets the color of the object. More... | |
void | SetColor (float r, float g, float b) |
Sets the color of the object. More... | |
void | SetColor (float r, float g, float b, float a) |
Sets the color of the object. More... | |
void | SetColor (D2D1::ColorF color) |
Sets the color of the object. More... | |
void | SetZOrder (int z) |
Sets the Z-Order of the object. More... | |
void | SetTranslation (float new_x, float new_y) |
Sets the translation of the object. More... | |
void | PokeTranslation () |
Updates the area of the object to account for any x/y coordinate changes. More... | |
void | SetSize (float new_width, float new_height) |
Sets the size of the object. More... | |
void | PokeSize () |
Updates the area of the object to account for any width/height changes. More... | |
void | ValidateSizeAndTranslation () |
Validates X/Y coordinates and Width/Height sizes after the area has been modified. More... | |
std::string | GetType () |
Retrieves the type of item that this stack object is. More... | |
std::string | GetDrawModeLabel () |
Retrieves the current drawing mode of the object. More... | |
Public Attributes | |
D2D1_RECT_F | area |
The area of the object. More... | |
D2D1_COLOR_F | color |
The color of the object. More... | |
int | z_order = 0 |
The Z-Order of the object. More... | |
StackType | type_label = STACKTYPE_GENERIC |
The type of the object. More... | |
StackItemDrawMode | draw_mode = DEFAULT_DRAWMODE |
The drawing mode of the object. More... | |
bool | visible = true |
Whether or not the object is visible. More... | |
float | x = 0 |
The X coordinate of the object. More... | |
float | y = 0 |
The Y coordinate of the object. More... | |
float | width = 100 |
The width of the object. More... | |
float | height = 100 |
The height of the object. More... | |
std::string | unique_id = "" |
The unique ID of this object. More... | |
Base class for all render stack objects.
|
inline |
Sets default values and provides a default ID to be used if none is provided.
|
inline |
Empty destructor.
|
inlinevirtual |
Draws the stack object.
Specific functionality may vary depending on the type of object.
Reimplemented in BlamRendering::RenderStack::Text, BlamRendering::RenderStack::BitmapText, BlamRendering::RenderStack::DWText, BlamRendering::RenderStack::Line, BlamRendering::RenderStack::Bitmap, BlamRendering::RenderStack::Ellipse, BlamRendering::RenderStack::RoundedRectangle, BlamRendering::RenderStack::DebugMenu, BlamRendering::RenderStack::Rectangle, BlamRendering::RenderStack::ImGUIObject, BlamRendering::RenderStack::DebugMenuItem, BlamRendering::RenderStack::ConsoleUI, BlamRendering::RenderStack::TickCounter, BlamRendering::RenderStack::FPSCounter, BlamRendering::RenderStack::Stats, and BlamRendering::RenderStack::CrashScreen.
std::string BlamRendering::RenderStack::StackObjectBase::GetDrawModeLabel | ( | ) |
Retrieves the current drawing mode of the object.
std::string BlamRendering::RenderStack::StackObjectBase::GetType | ( | ) |
Retrieves the type of item that this stack object is.
|
inlinevirtual |
Called upon window resize events.
Used to instruct the items to resize if need be.
Reimplemented in BlamRendering::RenderStack::ConsoleUI.
void BlamRendering::RenderStack::StackObjectBase::PokeSize | ( | ) |
Updates the area of the object to account for any width/height changes.
Not required if translation is modified using SetSize(). Only required if the width and height properties are modified directly.
void BlamRendering::RenderStack::StackObjectBase::PokeTranslation | ( | ) |
Updates the area of the object to account for any x/y coordinate changes.
Not required if translation is modified using SetTranslation(). Only required if the X and Y coordinate properties are modified directly.
void BlamRendering::RenderStack::StackObjectBase::SetArea | ( | D2D1_RECT_F | new_area | ) |
Sets the area of the object.
new_area | - The new area of the object. |
void BlamRendering::RenderStack::StackObjectBase::SetArea | ( | float | new_area[4] | ) |
Sets the area of the object.
new_area | - The new area of the object. Items must be in the following order:
|
void BlamRendering::RenderStack::StackObjectBase::SetArea | ( | float | top, |
float | bottom, | ||
float | left, | ||
float | right | ||
) |
Sets the area of the object.
top | - The top edge of the area. |
bottom | - The bottom edge of the area. |
left | - The left edge of the area. |
right | - The right edge of the area. |
void BlamRendering::RenderStack::StackObjectBase::SetColor | ( | D2D1::ColorF | color | ) |
Sets the color of the object.
Color values range from 0.0f
to 1.0f
.
color | - The new color of the object. |
void BlamRendering::RenderStack::StackObjectBase::SetColor | ( | float | new_color[3] | ) |
Sets the color of the object.
Color values range from 0.0f
to 1.0f
.
new_color | - The new color of the object. Items must be in the following order:
|
void BlamRendering::RenderStack::StackObjectBase::SetColor | ( | float | r, |
float | g, | ||
float | b | ||
) |
Sets the color of the object.
Color values range from 0.0f
to 1.0f
.
r | - The Red value of the color. |
g | - The Green value of the color. |
b | - The Blue value of the color. |
void BlamRendering::RenderStack::StackObjectBase::SetColor | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) |
Sets the color of the object.
Color values range from 0.0f
to 1.0f
.
r | - The Red value of the color. |
g | - The Green value of the color. |
b | - The Blue value of the color. |
a | - The Alpha value of the color. |
void BlamRendering::RenderStack::StackObjectBase::SetSize | ( | float | new_width, |
float | new_height | ||
) |
Sets the size of the object.
new_width | - The new width of the object. |
new_height | - The new height of the object. |
void BlamRendering::RenderStack::StackObjectBase::SetTranslation | ( | float | new_x, |
float | new_y | ||
) |
Sets the translation of the object.
new_x | - The new X coordinate of the object. |
new_y | - The new Y coordinate of the object. |
void BlamRendering::RenderStack::StackObjectBase::SetZOrder | ( | int | z | ) |
Sets the Z-Order of the object.
z | - The new Z-order. |
|
inlinevirtual |
Shows a set of ImGUI properties associated with the object.
This will call functions to draw only the property controls for the item, and nothing else. The window/container for the properties must be handled externally.
Reimplemented in BlamRendering::RenderStack::Text, BlamRendering::RenderStack::BitmapText, BlamRendering::RenderStack::DWText, BlamRendering::RenderStack::Line, BlamRendering::RenderStack::Bitmap, BlamRendering::RenderStack::DebugMenu, BlamRendering::RenderStack::Ellipse, BlamRendering::RenderStack::RoundedRectangle, BlamRendering::RenderStack::Rectangle, BlamRendering::RenderStack::ImGUIObject, BlamRendering::RenderStack::DebugMenuItem, BlamRendering::RenderStack::ConsoleUI, BlamRendering::RenderStack::TickCounter, BlamRendering::RenderStack::FPSCounter, BlamRendering::RenderStack::Stats, and BlamRendering::RenderStack::CrashScreen.
void BlamRendering::RenderStack::StackObjectBase::ValidateSizeAndTranslation | ( | ) |
Validates X/Y coordinates and Width/Height sizes after the area has been modified.
The area placement overrides the coords and size, and as such those properties will be lost and updated to represent the configured area.
D2D1_RECT_F BlamRendering::RenderStack::StackObjectBase::area |
The area of the object.
D2D1_COLOR_F BlamRendering::RenderStack::StackObjectBase::color |
The color of the object.
StackItemDrawMode BlamRendering::RenderStack::StackObjectBase::draw_mode = DEFAULT_DRAWMODE |
The drawing mode of the object.
float BlamRendering::RenderStack::StackObjectBase::height = 100 |
The height of the object.
StackType BlamRendering::RenderStack::StackObjectBase::type_label = STACKTYPE_GENERIC |
The type of the object.
std::string BlamRendering::RenderStack::StackObjectBase::unique_id = "" |
The unique ID of this object.
bool BlamRendering::RenderStack::StackObjectBase::visible = true |
Whether or not the object is visible.
float BlamRendering::RenderStack::StackObjectBase::width = 100 |
The width of the object.
float BlamRendering::RenderStack::StackObjectBase::x = 0 |
The X coordinate of the object.
float BlamRendering::RenderStack::StackObjectBase::y = 0 |
The Y coordinate of the object.
int BlamRendering::RenderStack::StackObjectBase::z_order = 0 |
The Z-Order of the object.