Class LinkCode
- Namespace
- MLEM.Formatting.Codes
- Assembly
- MLEM.dll
An instance of a formatting code that can be used for a TextFormatter. To add a new formatting code, see Codes
public class LinkCode : UnderlineCode, IGenericDataHolder
- Inheritance
-
LinkCode
- Implements
- Inherited Members
- Extension Methods
Constructors
LinkCode(Match, Regex, float, float, Func<Token, bool>, Func<Color, Color?>)
public LinkCode(Match match, Regex regex, float thickness, float yOffset, Func<Token, bool> isSelected, Func<Color, Color?> color)
Parameters
match
Matchregex
Regexthickness
floatyOffset
floatisSelected
Func<Token, bool>color
Func<Color, Color?>
LinkCode(Match, Regex, float, float, Func<Token, bool>, Color?)
public LinkCode(Match match, Regex regex, float thickness, float yOffset, Func<Token, bool> isSelected, Color? color = null)
Parameters
Methods
DrawCharacter(GameTime, SpriteBatch, int, string, Token, int, ref Vector2, GenericFont, ref Color, ref float, float)
Draws a given code point using this token's formatting options.
public override bool DrawCharacter(GameTime time, SpriteBatch batch, int codePoint, string character, Token token, int indexInToken, ref Vector2 pos, GenericFont font, ref Color color, ref float scale, float depth)
Parameters
time
GameTimeThe time
batch
SpriteBatchThe sprite batch to use
codePoint
intThe code point of the character to draw
character
stringThe string representation of the character to draw
token
TokenindexInToken
intThe index within this token that the character is at
pos
Vector2The position to draw the token at
font
GenericFontThe font to use to draw
color
ColorThe color to draw with
scale
floatThe scale to draw at
depth
floatThe depth to draw at
Returns
GetColor(Color)
Get the color that this token will be rendered with
public override Color? GetColor(Color defaultPick)
Parameters
defaultPick
ColorThe default color, if none is specified
Returns
- Color?
The color to render with
IsSelected()
Returns true if this link formatting code is currently selected or hovered over, based on the selection function.
public virtual bool IsSelected()
Returns
- bool
True if this code is currently selected