H3lp Yours3lfDocs
api

widget

Build a passive base Widget layout.

Builds a plain ui.TYPE.Widget, optionally containing child layouts. Use it for neutral composition or custom geometry without an OpenMW built-in template.

Example

local ui = require 'openmw.ui'
local util = require 'openmw.util'
local widget = require 'scripts.s3.components.widget'
local text = require 'scripts.s3.components.text'

ui.create {
  layer = 'Windows',
  props = {
    size = util.vector2(240, 40),
  },
  content = ui.content {
    widget {
      props = {
        size = util.vector2(240, 40),
      },
      children = {
        text {
          text = 'A neutral widget',
        },
      },
    },
  },
}

Parameters

FieldTypeDescription
contenttable?Child content; takes precedence over children.
childrentable?Child layouts used when content is absent.

Common layout fields are documented on the UI Components overview.

See also

container · box · column