Call as
addon:CreateConditionPositionPad()
Available directly through addon; no dependency is needed.
What it does
Create a native position pad using the shared directional controls. OnOffsetChanged reports horizontal and vertical direction, whether Center was pressed, and the increment (one, or ten with Shift). SetDisabled controls interaction; add the pad to the callback parent with parent:AddChild(widget).
Arguments
| Name | Type | What it does |
|---|---|---|
self | RMAddon | Rotation Master addon instance (implicit with colon calls). |
Returns
| 1 | RMConditionPositionPad | Native directional pad with center reset and lease-protected callbacks. |
|---|
Editions
Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.
It reads no game API directly.
Example
local pad = addon:CreateConditionPositionPad()
pad:SetCallback("OnOffsetChanged", function(_, _, dx, dy, center, amount)
if center then value.x, value.y = 0, 0 else value.x, value.y = (value.x or 0) + dx * amount, (value.y or 0) + dy * amount end
end)
parent:AddChild(pad)Dependencies
constructor→UI.condition_position.constructor
Source
UI/condition_position.lua, line 52. Read only in game; Duplicate makes an editable copy.
UI.condition_position.CreateConditionPositionPad(self)
return self:AcquireConditionWidget('RM-ConditionPositionPad',constructor)