Skip to content
S3ctor’s S3cret St4sh
api

text

Add Morrowind-styled text to a layout.

Builds a ui.TYPE.Text layout and supplies props.text. Without a template, H3 applies Morrowind's normal text color and size.

Example

local ui = require 'openmw.ui'
local H3UI = require('openmw.interfaces').H3UI

ui.create {
  type = ui.TYPE.Container,
  layer = 'Windows',
  content = ui.content {
    H3UI.text {
      text = 'Hello from H3',
      props = {
        textAlignH = ui.ALIGNMENT.Center,
      },
    },
  },
}

Parameters

FieldTypeDescription
textstring?Initial text; copied to props.text.
templateopenmw.ui.Template?Replaces the default text template.

Common layout fields are documented on the UI Components overview.

See also

textInput · caption · listItem

String shorthand

text 'Settings' is equivalent to text { text = 'Settings' }.