Builds the vanilla up/down pin control. It is fixed at 19×19 pixels and changes its skin when clicked.
Example
local ui = require 'openmw.ui'
local pinButton = require 'scripts.s3.components.pinButton'
local pinned = false
local element
element = ui.create {
type = ui.TYPE.Container,
layer = 'Windows',
content = ui.content {
pinButton {
pinned = pinned,
onToggle = function(value)
pinned = value
print('Pinned:', value)
element:update()
end,
},
},
}Parameters
| Field | Type | Description |
|---|---|---|
pinned | boolean? | Initial pin state; defaults to false. |
onToggle | function? | Receives the new pin state. |
Common layout fields are documented on the UI Components overview. A supplied props.size must be exactly 19×19. The component does not update the mounted element or persist the pin state.