H3lp Yours3lfDocs
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 text = require 'scripts.s3.components.text'

ui.create {
  type = ui.TYPE.Container,
  layer = 'Windows',
  content = ui.content {
    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