GL Studio C++ Runtime API
GlsTextBox::UnderlineStrikeThruHelper Class Reference

#include <gls_text_box.h>

Public Member Functions

 UnderlineStrikeThruHelper (float cellWidth, float cellHeight, float cellYScale, bool shadow, const Vector &shadowOffset, const GlsColor &shadowColor, float underlineOffset, float underlineSize, bool halo, float haloOffset, GlsColor haloColor, bool leftToRight)
 
void NewRow ()
 
void PreProcessCharacter (const CharAttr_t &charAttr, const Char_t &c, float cellX, float charY)
 
void PostProcessCharacter (const CharAttr_t &charAttr, const Char_t &c, float cellX, float charY, float cellWidth, bool endOfLine)
 
void RenderLineSegments ()
 
void IgnoreShadow ()
 Sets the underlying shadow visibility flag to false.
 
void AllowShadow ()
 Sets the underlying shadow visibility flag to true.
 

Protected Types

typedef std::list< LineSegment_tLineSegmentCont_t
 Typedef for a list of line segments.
 

Protected Attributes

const float _cellWidth
 Height of each character cell in the grid in logical units.
 
const float _cellHeight
 Width of each character cell in the grid in logical units.
 
const bool _shadow
 Whether or not the shadow effect is on.
 
const Vector _shadowOffset
 Offset of the shadow effect from the characters. Z component is ignored.
 
const GlsColor _shadowColor
 Color of the shadow effect behind the characters.
 
bool _allowShadow
 Whether or not shadows are being drawn in general.
 
const float _underlineOffset
 Vertical offset of the underline in logical units.
 
const float _underlineSize
 Thickness of the underline in logical units.
 
const bool _halo
 Whether or not the halo effect is on.
 
const float _haloOffset
 Offset multiplier for the halo effect.
 
const GlsColor _haloColor
 Color of the halo effect behind the characters.
 
const bool _leftToRight
 If true, characters are rendered left to right, otherwise right to left.
 
float _underlineX1
 Current underline state left X coordinate.
 
float _underlineX2
 Current underline state right X coordinate.
 
float _underlineY
 Current underline state Y coordinate.
 
float _underlineScale
 Current underline drawing scale.
 
GlsColor _underlineColor
 Current underline drawing color.
 
bool _underlineOn
 If true, underline drawing is enabled.
 
float _strikeX1
 Current strike through state left X coordinate.
 
float _strikeX2
 Current strike through state right X coordinate.
 
float _strikeY
 Current strike through state Y coordinate.
 
float _strikeScale
 Current strike through drawing scale.
 
GlsColor _strikeColor
 Current strike through drawing color.
 
bool _strikeOn
 If true, strike through drawing is enabled.
 
bool _whiteSpaceYes
 If true, the currently processed character is whitespace.
 
LineSegmentCont_t _lineSegments
 The list of line segments to draw.
 

Detailed Description

A helper class for processing underline and strike-thru when drawing text grid.

Constructor & Destructor Documentation

◆ UnderlineStrikeThruHelper()

UnderlineStrikeThruHelper ( float  cellWidth,
float  cellHeight,
float  cellYScale,
bool  shadow,
const Vector shadowOffset,
const GlsColor shadowColor,
float  underlineOffset,
float  underlineSize,
bool  halo,
float  haloOffset,
GlsColor  haloColor,
bool  leftToRight 
)
Parameters
cellWidthmaximum width of a character cell in the text box
cellHeightheight of a character cell in the text box
cellYScaleunused
shadowtrue if text box has shadow enabled
shadowOffsetoffset for shadow
shadowColorcolor of shadow in text box
underlineOffsetoffset of underline
underlineSizesize of underline
halotrue if text box has halo enabled
haloOffsetoffset for halo
haloColorcolor of halo in text box
leftToRighttrue if text flows left to right else false for right to left

Member Function Documentation

◆ NewRow()

void NewRow ( )

Setup to process a new row in the text box.

◆ PostProcessCharacter()

void PostProcessCharacter ( const CharAttr_t charAttr,
const Char_t c,
float  cellX,
float  charY,
float  cellWidth,
bool  endOfLine 
)

Post Process the given character attributes

Parameters
charAttrattributes in question
cthe character code to process.
cellXx coord of character cell
charYy coord of character cell
cellWidththe width of the current character
endOfLinetrue if character was the end of the current line

◆ PreProcessCharacter()

void PreProcessCharacter ( const CharAttr_t charAttr,
const Char_t c,
float  cellX,
float  charY 
)

Pre Process the given character attributes

Parameters
charAttrattributes in question
cthe character code to process.
cellXx coord of character cell
charYy coord of character

◆ RenderLineSegments()

void RenderLineSegments ( )

Render the line segments for the underline / strikethru


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