Table of Contents

Class BitmapText

Namespace
PluginUI
Assembly
PluginUI.dll

Text drawn with a BitmapFont (iPlug2 IBTextControl): fixed text or text refreshed every frame (TextSource), integer pixel scaling, alignment, character spacing and an optional dim "unlit segments" background that mimics LCD / VFD displays.

public class BitmapText : Control
Inheritance
BitmapText
Inherited Members

Constructors

BitmapText()

Creates a bitmap text element.

public BitmapText()

Properties

CellCount

Fixed number of character cells (0 = length of the text); unused cells show the "unlit" glyph.

public int CellCount { get; set; }

Property Value

int

CharacterSpacing

Extra space between glyphs, in glyph pixels before scaling.

public float CharacterSpacing { get; set; }

Property Value

float

CurrentText

Text currently displayed (TextSource result or Text).

[Browsable(false)]
public string CurrentText { get; }

Property Value

string

DefaultSize

Natural size used when no explicit size is given.

protected override Size DefaultSize { get; }

Property Value

Size

DrawBackground

Draws a dark display background behind the text.

public bool DrawBackground { get; set; }

Property Value

bool

Font

The font (nothing is drawn while it is null).

[Browsable(false)]
public BitmapFont? Font { get; set; }

Property Value

BitmapFont

PixelScale

Glyph magnification: 0 = fit the height of the element, otherwise an exact factor (use integers for pixel fonts).

public float PixelScale { get; set; }

Property Value

float

Text

Text to display.

public string? Text { get; set; }

Property Value

string

TextAlignment

Horizontal alignment of the text inside the element.

public HorizontalAlignment TextAlignment { get; set; }

Property Value

HorizontalAlignment

TextSource

Function polled every frame for live text (meters, counters); overrides Text when set.

[Browsable(false)]
public Func<string?>? TextSource { get; set; }

Property Value

Func<string>

UnlitCharacter

Character drawn dimmed behind every cell (e.g. '8' or a full block for LCD displays); '\0' = none.

public char UnlitCharacter { get; set; }

Property Value

char

UnlitOpacity

Opacity of the unlit characters.

public float UnlitOpacity { get; set; }

Property Value

float

Methods

OnAttached()

Called when the element joins a host (subscribe to external events here).

protected override void OnAttached()

OnDetached()

Called when the element leaves its host (unsubscribe here).

protected override void OnDetached()

RenderVector(DrawingContext, Rect, VectorStyle)

Vector rendering of the widget area.

protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)

Parameters

dc DrawingContext
widget Rect
style VectorStyle