Table of Contents

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 Match
regex Regex
thickness float
yOffset float
isSelected 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

match Match
regex Regex
thickness float
yOffset float
isSelected Func<Token, bool>
color Color?

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 GameTime

The time

batch SpriteBatch

The sprite batch to use

codePoint int

The code point of the character to draw

character string

The string representation of the character to draw

token Token
indexInToken int

The index within this token that the character is at

pos Vector2

The position to draw the token at

font GenericFont

The font to use to draw

color Color

The color to draw with

scale float

The scale to draw at

depth float

The depth to draw at

Returns

bool

GetColor(Color)

Get the color that this token will be rendered with

public override Color? GetColor(Color defaultPick)

Parameters

defaultPick Color

The 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