Links |
---|
Shifts a region.
region:AdjustPointsOffset(adjustX, adjustY)
Arguments
- adjustX
- number - Distance right (+) or left (-).
- adjustY
- number - Distance up (+) or down (-).
Details
- Equivalent to looping through all anchors and adding to their x and y offsets.
- Pairs with Region:ClearPointsOffset() if the default state is (0,0) for all anchors.
Example
Shifts a region each second by either (-200,0)
or (200,0)
:
local frame = CreateFrame("Frame")
frame:SetPoint("CENTER", 100, 0)
frame:SetSize(100,100)
local texture = frame:CreateTexture(nil, "BACKGROUND")
texture:SetColorTexture(1,0,0)
texture:SetAllPoints()
local nextShift = -200
local function shiftFrame()
frame:AdjustPointsOffset(nextShift, 0)
nextShift = -nextShift
end
C_Timer.NewTicker(1, shiftFrame)
Patch changes
Patch 9.0.1 (2020-10-13): Added.[1]
References
- ^ 9.0.1 vs 8.3.7 diffs at wow-ui-source