Class StackObjectBase

Inheritance Relationships

Derived Types

Class Documentation

class StackObjectBase

Base class for all render stack objects.

Subclassed by BlamRendering::RenderStack::Bitmap, BlamRendering::RenderStack::BitmapText, BlamRendering::RenderStack::ConsoleUI, BlamRendering::RenderStack::DebugMenu, BlamRendering::RenderStack::DebugMenuItem, BlamRendering::RenderStack::DWText, BlamRendering::RenderStack::Ellipse, BlamRendering::RenderStack::FPSCounter, BlamRendering::RenderStack::ImGUIObject, BlamRendering::RenderStack::Line, BlamRendering::RenderStack::Rectangle, BlamRendering::RenderStack::RoundedRectangle, BlamRendering::RenderStack::StackGroup, BlamRendering::RenderStack::Stats, BlamRendering::RenderStack::Text

Public Functions

StackObjectBase()

Sets default values and provides a default ID to be used if none is provided.

~StackObjectBase()

Empty destructor.

virtual void Draw()

Draws the stack object.

Specific functionality may vary depending on the type of object.

virtual void ShowImPropertyEditor()

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.

virtual void HandleResize()

Called upon window resize events.

Used to instruct the items to resize if need be.

void SetArea(float new_area[4])

Sets the area of the object.

Parameters
  • new_area: - The new area of the object. Items must be in the following order:

void SetArea(float top, float bottom, float left, float right)

Sets the area of the object.

Parameters
  • 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 SetArea(D2D1_RECT_F new_area)

Sets the area of the object.

Parameters
  • new_area: - The new area of the object.

void SetColor(float new_color[3])

Sets the color of the object.

Color values range from 0.0f to 1.0f.

Parameters
  • new_color: - The new color of the object. Items must be in the following order:

void SetColor(float r, float g, float b)

Sets the color of the object.

Color values range from 0.0f to 1.0f.

Parameters
  • r: - The Red value of the color.

  • g: - The Green value of the color.

  • b: - The Blue value of the color.

void SetColor(float r, float g, float b, float a)

Sets the color of the object.

Color values range from 0.0f to 1.0f.

Parameters
  • 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 SetColor(D2D1::ColorF color)

Sets the color of the object.

Color values range from 0.0f to 1.0f.

Parameters
  • color: - The new color of the object.

void SetZOrder(int z)

Sets the Z-Order of the object.

Parameters
  • z: - The new Z-order.

void SetTranslation(float new_x, float new_y)

Sets the translation of the object.

Parameters
  • new_x: - The new X coordinate of the object.

  • new_y: - The new Y coordinate of the object.

void 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 SetSize(float new_width, float new_height)

Sets the size of the object.

Parameters
  • new_width: - The new width of the object.

  • new_height: - The new height of the object.

void 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 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.

std::string GetType()

Retrieves the type of item that this stack object is.

Return

A string containing the name of the stack type.

std::string GetDrawModeLabel()

Retrieves the current drawing mode of the object.

Return

A string containing the name of the drawing mode.

Public Members

D2D1_RECT_F area

The area of the object.

D2D1_COLOR_F color

The color of the object.

int z_order = 0

The Z-Order of the object.

StackType type_label = STACKTYPE_GENERIC

The type of the object.

StackItemDrawMode draw_mode = DEFAULT_DRAWMODE

The drawing mode of the object.

bool visible = true

Whether or not the object is visible.

float x = 0

The X coordinate of the object.

float y = 0

The Y coordinate of the object.

float width = 100

The width of the object.

float height = 100

The height of the object.

std::string unique_id = ""

The unique ID of this object.