Blamite Game Engine - Blam (Core)
BlamRendering::RenderStack::StackObjectBase Class Reference

Base class for all render stack objects. More...

#include <render_stack.h>

+ Inheritance diagram for BlamRendering::RenderStack::StackObjectBase:

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

Detailed Description

Base class for all render stack objects.

Constructor & Destructor Documentation

◆ StackObjectBase()

BlamRendering::RenderStack::StackObjectBase::StackObjectBase ( )
inline

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

◆ ~StackObjectBase()

BlamRendering::RenderStack::StackObjectBase::~StackObjectBase ( )
inline

Empty destructor.

Member Function Documentation

◆ Draw()

◆ GetDrawModeLabel()

std::string BlamRendering::RenderStack::StackObjectBase::GetDrawModeLabel ( )

Retrieves the current drawing mode of the object.

Returns
A string containing the name of the drawing mode.

◆ GetType()

std::string BlamRendering::RenderStack::StackObjectBase::GetType ( )

Retrieves the type of item that this stack object is.

Returns
A string containing the name of the stack type.

◆ HandleResize()

virtual void BlamRendering::RenderStack::StackObjectBase::HandleResize ( )
inlinevirtual

Called upon window resize events.

Used to instruct the items to resize if need be.

Reimplemented in BlamRendering::RenderStack::ConsoleUI.

◆ PokeSize()

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.

◆ PokeTranslation()

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.

◆ SetArea() [1/3]

void BlamRendering::RenderStack::StackObjectBase::SetArea ( D2D1_RECT_F  new_area)

Sets the area of the object.

Parameters
new_area- The new area of the object.

◆ SetArea() [2/3]

void BlamRendering::RenderStack::StackObjectBase::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:

top, bottom, left, right

◆ SetArea() [3/3]

void BlamRendering::RenderStack::StackObjectBase::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.

◆ SetColor() [1/4]

void BlamRendering::RenderStack::StackObjectBase::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.

◆ SetColor() [2/4]

void BlamRendering::RenderStack::StackObjectBase::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:

red, green, blue

◆ SetColor() [3/4]

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.

Parameters
r- The Red value of the color.
g- The Green value of the color.
b- The Blue value of the color.

◆ SetColor() [4/4]

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.

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.

◆ SetSize()

void BlamRendering::RenderStack::StackObjectBase::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.

◆ SetTranslation()

void BlamRendering::RenderStack::StackObjectBase::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.

◆ SetZOrder()

void BlamRendering::RenderStack::StackObjectBase::SetZOrder ( int  z)

Sets the Z-Order of the object.

Parameters
z- The new Z-order.
Todo:
Make Z-Order used. Currently does nothing.

◆ ShowImPropertyEditor()

◆ ValidateSizeAndTranslation()

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.

Member Data Documentation

◆ area

D2D1_RECT_F BlamRendering::RenderStack::StackObjectBase::area

The area of the object.

◆ color

D2D1_COLOR_F BlamRendering::RenderStack::StackObjectBase::color

The color of the object.

◆ draw_mode

StackItemDrawMode BlamRendering::RenderStack::StackObjectBase::draw_mode = DEFAULT_DRAWMODE

The drawing mode of the object.

◆ height

float BlamRendering::RenderStack::StackObjectBase::height = 100

The height of the object.

◆ type_label

StackType BlamRendering::RenderStack::StackObjectBase::type_label = STACKTYPE_GENERIC

The type of the object.

◆ unique_id

std::string BlamRendering::RenderStack::StackObjectBase::unique_id = ""

The unique ID of this object.

◆ visible

bool BlamRendering::RenderStack::StackObjectBase::visible = true

Whether or not the object is visible.

◆ width

float BlamRendering::RenderStack::StackObjectBase::width = 100

The width of the object.

◆ x

float BlamRendering::RenderStack::StackObjectBase::x = 0

The X coordinate of the object.

◆ y

float BlamRendering::RenderStack::StackObjectBase::y = 0

The Y coordinate of the object.

◆ z_order

int BlamRendering::RenderStack::StackObjectBase::z_order = 0

The Z-Order of the object.


The documentation for this class was generated from the following files: