TextVisual

open class TextVisual(    text: String,     font: Font = Font(),     alignment: Alignment = Alignment.CENTER,     offsetX: Number = 0,     offsetY: Number = 0) : SingleLayerVisual

A visual displaying text.

Parameters

text

Text to display.

font

Font to be used for the text. Default: default Font constructor.

alignment

Alignment for the text. Default: Alignment.CENTER.

offsetX

The horizontal offset of the text from its anchorpoint. Default: 0.

offsetY

The vertical offset of the text from its anchorpoint. Default: 0.

Constructors

Link copied to clipboard
fun TextVisual(    text: String,     font: Font = Font(),     alignment: Alignment = Alignment.CENTER,     offsetX: Number = 0,     offsetY: Number = 0)

Creates a TextVisual with given text.

Functions

Link copied to clipboard
fun addListener(listener: Observer)

Adds a listener silently.

Link copied to clipboard
fun addListenerAndInvoke(listener: Observer)

Adds a listener and calls Observer.update on this new listener.

Link copied to clipboard
fun clearListeners()

Removes all listeners.

Link copied to clipboard
open override fun copy(): TextVisual

Copies this TextVisual to a new object.

Link copied to clipboard
fun notifyChange()

Notifies all listeners by calling Observer.update.

Link copied to clipboard
fun removeListener(listener: Observer): Boolean

Removes a listener.

Properties

Link copied to clipboard
var alignment: Alignment

The text.

Link copied to clipboard
val alignmentProperty: Property<Alignment>

Property for the text.

Link copied to clipboard
open var backgroundRadius: BackgroundRadius?

Background radius.

Link copied to clipboard
var backgroundRadiusProperty: Property<BackgroundRadius?>

Property for backgroundRadius.

Link copied to clipboard
open var borderColor: BorderColor?

Border color.

Link copied to clipboard
var borderColorProperty: Property<BorderColor?>

Property for borderColor.

Link copied to clipboard
open var borderRadius: BorderRadius?

Border radius.

Link copied to clipboard
var borderRadiusProperty: Property<BorderRadius?>

Property for borderRadius.

Link copied to clipboard
open var borderStyle: BorderStyle?

Border style.

Link copied to clipboard
var borderStyleProperty: Property<BorderStyle?>

Property for borderStyle.

Link copied to clipboard
open var borderWidth: BorderWidth?

Border width.

Link copied to clipboard
var borderWidthProperty: Property<BorderWidth?>

Property for borderWidth.

Link copied to clipboard
open var cursor: Cursor?

Cursor.

Link copied to clipboard
var cursorProperty: Property<Cursor?>

Property for cursor.

Link copied to clipboard
var font: Font

The displayed text.

Link copied to clipboard
val fontProperty: Property<Font>

Property for the displayed text.

Link copied to clipboard
var offsetX: Double

The x-axis text offset.

Link copied to clipboard
val offsetXProperty: DoubleProperty

Property for the x-axis text offset.

Link copied to clipboard
var offsetY: Double

The y-axis text offset.

Link copied to clipboard
val offsetYProperty: DoubleProperty

Property for the y-axis text offset.

Link copied to clipboard
var style: String

Css style that gets applied to this Visual.

Link copied to clipboard
val styleProperty: StringProperty

Property for the css style that gets applied to this Visual.

Link copied to clipboard
var text: String

The displayed text.

Link copied to clipboard
val textProperty: StringProperty

Property for the displayed text.

Link copied to clipboard
var transparency: Double

The transparency / alpha channel for this Visual.

Link copied to clipboard
val transparencyProperty: LimitedDoubleProperty

Property for the transparency / alpha channel for this Visual.