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

Class representing text drawn using a Bitmap-based engine font. More...

#include <render_stack.h>

+ Inheritance diagram for BlamRendering::RenderStack::BitmapText:

Public Member Functions

 BitmapText ()
 Sets the stack type, default shadow color, and default zone color. More...
 
 ~BitmapText ()
 Releases the rendered bitmap containing the text. More...
 
void Draw ()
 Draws the stack object. More...
 
void ShowImPropertyEditor ()
 Shows a set of ImGUI properties associated with the object. More...
 
void updateCachedProperties ()
 Updates the currently cached properties. More...
 
bool hasAnyPropertyChanged ()
 Determines if any current properties differ from their cached copies. More...
 
- Public Member Functions inherited from BlamRendering::RenderStack::StackObjectBase
 StackObjectBase ()
 Sets default values and provides a default ID to be used if none is provided. More...
 
 ~StackObjectBase ()
 Empty destructor. 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

std::string font_id = "undefined"
 The ID of the font. More...
 
std::string text = "abba"
 The text to display. More...
 
int shadow_x = 1
 The X offset of the drop shadow. More...
 
int shadow_y = 1
 The Y offset of the drop shadow. More...
 
D2D1_COLOR_F shadow_color
 The color to use for the drop shadow. More...
 
bool use_shadow = false
 Whether or not to draw the text with a drop shadow. More...
 
bool show_zone = false
 Whether or not to show the text zone. More...
 
D2D1_COLOR_F zone_color
 The color to use for the zone border. More...
 
float zone_thickness = 1
 The thickness of the zone border. More...
 
ID2D1Bitmap * text_bitmap
 The bitmap containing the fully rendered representation of the object. More...
 
D2D1_RECT_F text_area
 The area to use for the text bitmap. More...
 
int bitmap_width = 0
 The width of the bitmap. More...
 
int bitmap_height = 0
 The height of the bitmap. More...
 
bool force_regenerate = false
 If enabled, will force the bitmap to regenerate on the next frame. More...
 
bool currently_locked = false
 While drawing, this is used to prevent deletion. More...
 
bool replace_color_codes = false
 Whether or not to replace any instances of %& with 0xB00B for color codes. More...
 
char text_buffer [1024] = ""
 Text buffer for ImGUI editor. More...
 
char font_buffer [256] = ""
 Font name buffer for ImGUI editor. More...
 
std::string c_font
 Cached copy of font More...
 
std::string c_text
 Cached copy of text More...
 
float c_x
 Cached copy of x More...
 
float c_y
 Cached copy of y More...
 
D2D1_COLOR_F c_color
 Cached copy of color More...
 
bool c_use_shadow
 Cached copy of use_shadow More...
 
int c_shadow_x
 Cached copy of shadow_x More...
 
int c_shadow_y
 Cached copy of shadow_y More...
 
D2D1_COLOR_F c_shadow_color
 Cached copy of shadow_color More...
 
bool c_show_zone
 Cached copy of show_zone More...
 
D2D1_COLOR_F c_zone_color
 Cached copy of zone_color More...
 
float c_zone_thickness
 Cached copy of zone_thickness More...
 
int c_bitmap_width
 Cached copy of bitmap_width More...
 
int c_bitmap_height
 Cached copy of bitmap_height More...
 
float c_scale_factor
 Cachced copy of the ui_scale_factor global. More...
 
bool c_replace_color_codes
 Cached copy of c_replace_color_codes. More...
 
- Public Attributes inherited from BlamRendering::RenderStack::StackObjectBase
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

Class representing text drawn using a Bitmap-based engine font.

Constructor & Destructor Documentation

◆ BitmapText()

BlamRendering::RenderStack::BitmapText::BitmapText ( )
inline

Sets the stack type, default shadow color, and default zone color.

◆ ~BitmapText()

BlamRendering::RenderStack::BitmapText::~BitmapText ( )
inline

Releases the rendered bitmap containing the text.

Member Function Documentation

◆ Draw()

void BlamRendering::RenderStack::BitmapText::Draw ( )
virtual

Draws the stack object.

Specific functionality may vary depending on the type of object.

Reimplemented from BlamRendering::RenderStack::StackObjectBase.

◆ hasAnyPropertyChanged()

bool BlamRendering::RenderStack::BitmapText::hasAnyPropertyChanged ( )

Determines if any current properties differ from their cached copies.

Returns
Whether or not any cached properties are different.

◆ ShowImPropertyEditor()

void BlamRendering::RenderStack::BitmapText::ShowImPropertyEditor ( )
virtual

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

◆ updateCachedProperties()

void BlamRendering::RenderStack::BitmapText::updateCachedProperties ( )

Updates the currently cached properties.

The cached properties are used to avoid unneeded regeneration of the text bitmap when only things like the location have changed.

Member Data Documentation

◆ bitmap_height

int BlamRendering::RenderStack::BitmapText::bitmap_height = 0

The height of the bitmap.

◆ bitmap_width

int BlamRendering::RenderStack::BitmapText::bitmap_width = 0

The width of the bitmap.

◆ c_bitmap_height

int BlamRendering::RenderStack::BitmapText::c_bitmap_height

Cached copy of bitmap_height

◆ c_bitmap_width

int BlamRendering::RenderStack::BitmapText::c_bitmap_width

Cached copy of bitmap_width

◆ c_color

D2D1_COLOR_F BlamRendering::RenderStack::BitmapText::c_color

Cached copy of color

◆ c_font

std::string BlamRendering::RenderStack::BitmapText::c_font

Cached copy of font

◆ c_replace_color_codes

bool BlamRendering::RenderStack::BitmapText::c_replace_color_codes

Cached copy of c_replace_color_codes.

◆ c_scale_factor

float BlamRendering::RenderStack::BitmapText::c_scale_factor

Cachced copy of the ui_scale_factor global.

◆ c_shadow_color

D2D1_COLOR_F BlamRendering::RenderStack::BitmapText::c_shadow_color

Cached copy of shadow_color

◆ c_shadow_x

int BlamRendering::RenderStack::BitmapText::c_shadow_x

Cached copy of shadow_x

◆ c_shadow_y

int BlamRendering::RenderStack::BitmapText::c_shadow_y

Cached copy of shadow_y

◆ c_show_zone

bool BlamRendering::RenderStack::BitmapText::c_show_zone

Cached copy of show_zone

◆ c_text

std::string BlamRendering::RenderStack::BitmapText::c_text

Cached copy of text

◆ c_use_shadow

bool BlamRendering::RenderStack::BitmapText::c_use_shadow

Cached copy of use_shadow

◆ c_x

float BlamRendering::RenderStack::BitmapText::c_x

Cached copy of x

◆ c_y

float BlamRendering::RenderStack::BitmapText::c_y

Cached copy of y

◆ c_zone_color

D2D1_COLOR_F BlamRendering::RenderStack::BitmapText::c_zone_color

Cached copy of zone_color

◆ c_zone_thickness

float BlamRendering::RenderStack::BitmapText::c_zone_thickness

Cached copy of zone_thickness

◆ currently_locked

bool BlamRendering::RenderStack::BitmapText::currently_locked = false

While drawing, this is used to prevent deletion.

◆ font_buffer

char BlamRendering::RenderStack::BitmapText::font_buffer[256] = ""

Font name buffer for ImGUI editor.

◆ font_id

std::string BlamRendering::RenderStack::BitmapText::font_id = "undefined"

The ID of the font.

◆ force_regenerate

bool BlamRendering::RenderStack::BitmapText::force_regenerate = false

If enabled, will force the bitmap to regenerate on the next frame.

◆ replace_color_codes

bool BlamRendering::RenderStack::BitmapText::replace_color_codes = false

Whether or not to replace any instances of %& with 0xB00B for color codes.

◆ shadow_color

D2D1_COLOR_F BlamRendering::RenderStack::BitmapText::shadow_color

The color to use for the drop shadow.

◆ shadow_x

int BlamRendering::RenderStack::BitmapText::shadow_x = 1

The X offset of the drop shadow.

◆ shadow_y

int BlamRendering::RenderStack::BitmapText::shadow_y = 1

The Y offset of the drop shadow.

◆ show_zone

bool BlamRendering::RenderStack::BitmapText::show_zone = false

Whether or not to show the text zone.

◆ text

std::string BlamRendering::RenderStack::BitmapText::text = "abba"

The text to display.

◆ text_area

D2D1_RECT_F BlamRendering::RenderStack::BitmapText::text_area

The area to use for the text bitmap.

◆ text_bitmap

ID2D1Bitmap* BlamRendering::RenderStack::BitmapText::text_bitmap

The bitmap containing the fully rendered representation of the object.

◆ text_buffer

char BlamRendering::RenderStack::BitmapText::text_buffer[1024] = ""

Text buffer for ImGUI editor.

◆ use_shadow

bool BlamRendering::RenderStack::BitmapText::use_shadow = false

Whether or not to draw the text with a drop shadow.

◆ zone_color

D2D1_COLOR_F BlamRendering::RenderStack::BitmapText::zone_color

The color to use for the zone border.

◆ zone_thickness

float BlamRendering::RenderStack::BitmapText::zone_thickness = 1

The thickness of the zone border.


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