Quick Ref - UI Text

A quick reference to the Text Widget & Style.

Widget

Constructor

dUI = require 'dmc_ui'

widget = dUI.newText()

widget = dUI.newText{
  text = "Hello",
  style = {
    -- style properties here
  }
}

Properties

widget.text = "hello"
widget.style

Properties (Style)

widget.debugOn
widget.width
widget.height
widget.anchorX

widget.align
widget.anchorY
widget.font
widget.fontSize
widget.marginX
widget.marginY
widget.textColor

widget.fillColor
widget.strokeColor
widget.strokeWidth

Methods (Style)

widget:setFillColor()
widget:setStrokeColor()
widget:setTextColor()

Style

Constructor

dUI = require 'dmc_ui'

style = dUI.newTextStyle{
  debugOn = false,
  width = 100,
  height = 50,

  align = 'left',
  anchorX = 0.5,
  anchorY = 1.0,
  font = 'helvetica-narrow',
  fontSize = 12,
  marginX = 10,
  marginY = 10,
  textColor = '#ff0000',

  fillColor = {1,1,1,1},
  strokeColor = {0.5,0,0,0,5},
  strokeWidth = 2
}

Properties

All properties listed above can also be accessed from the Style object:

style.anchorX = 0.5