Skip to content
S3ctor’s S3cret St4sh
api

box

Put content in the shared H3UI box treatment.

Builds an H3UI box around optional content using the active appearance's thin frame. H3 renders the frame above child content so images cannot cover the border. Supplying fixed size or relativeSize geometry keeps the framed surface at that geometry instead of allowing child content to resize it. Pass template to replace the H3 frame entirely.

Example

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

ui.create {
  type = ui.TYPE.Container,
  layer = 'Windows',
  content = ui.content {
    H3UI.box {
      children = {
        H3UI.text {
          text = 'A reusable framed H3UI.box',
        },
      },
    },
  },
}

Parameters

FieldTypeDescription
templateopenmw.ui.Template?Replaces the default OpenMW box template.
paddingnumber?Empty space between the frame and the content on all four sides; defaults to 4.
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

bookFrame · tooltip