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

#include <gls_text_grid.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 ProcessCharacter (const CharAttr_t &charAttr, float cellX, float nextCellX, float charY, bool endOfLine)
 
void RenderLineSegments ()
 
void IgnoreShadowAndHalo ()
 Sets the shadow visibility flag to false.
 

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.
 
LineSegmentCont_t _lineSegments
 The list of line segments to draw.
 

Detailed Description

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
cellWidthwidth of a character cell in the text grid
cellHeightheight of a character cell in the text grid
cellYScaleunused
shadowtrue if text grid has shadow enabled
shadowOffsetoffset for shadow
shadowColorcolor of shadow in text grid
underlineOffsetoffset of underline
underlineSizesize of underline
halotrue if text grid has halo enabled
haloOffsetoffset for halo
haloColorcolor of halo in text grid
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 grid

◆ ProcessCharacter()

void ProcessCharacter ( const CharAttr_t charAttr,
float  cellX,
float  nextCellX,
float  charY,
bool  endOfLine 
)

Pre Process the given character attributes

Parameters
charAttrattributes in question
cellXx coord of character cell
nextCellXx coord of character cell one past the given character
charYy coord of character
endOfLinetrue if character was the end of the current line

◆ RenderLineSegments()

void RenderLineSegments ( )

Render the line segments for the underline / strikethru


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