# SimpleFrameAPI (widget methods): World of Warcraft Forever API

Forever 1.60.1 (70959), Interface 16001, Lua 5.1, from Blizzard's own API documentation. Page: https://wowaddons.gg/forever-api/SimpleFrameAPI

## Functions

### AbortDrag

```lua
self:AbortDrag()
```

### AddRoleset

```lua
self:AddRoleset(roleset)
```

Adds a roleset tag to this frame without removing existing ones.

Protected: only Blizzard's own code may call it.

Arguments:
- `roleset`: string

### CanChangeAttribute

```lua
canChangeAttributes = self:CanChangeAttribute()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `canChangeAttributes`: bool

### ClearAlphaGradient

```lua
self:ClearAlphaGradient()
```

### ClearAttribute

```lua
cleared = self:ClearAttribute(attributeName)
```

Protected: only Blizzard's own code may call it.

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Arguments:
- `attributeName`: cstring

Returns:
- `cleared`: bool

### ClearAttributes

```lua
self:ClearAttributes()
```

Protected: only Blizzard's own code may call it.

### CreateFontString

```lua
line = self:CreateFontString([name], [drawLayer], [templateName])
```

Arguments:
- `name`: cstring, may be nil
- `drawLayer`: DrawLayer, may be nil
- `templateName`: cstring, may be nil

Returns:
- `line`: SimpleFontString

### CreateLine

```lua
line = self:CreateLine([name], [drawLayer], [templateName], [subLevel])
```

Arguments:
- `name`: cstring, may be nil
- `drawLayer`: DrawLayer, may be nil
- `templateName`: cstring, may be nil
- `subLevel`: number, may be nil

Returns:
- `line`: SimpleLine

### CreateMaskTexture

```lua
maskTexture = self:CreateMaskTexture([name], [drawLayer], [templateName], [subLevel])
```

Arguments:
- `name`: cstring, may be nil
- `drawLayer`: DrawLayer, may be nil
- `templateName`: cstring, may be nil
- `subLevel`: number, may be nil

Returns:
- `maskTexture`: SimpleMaskTexture

### CreateTexture

```lua
texture = self:CreateTexture([name], [drawLayer], [templateName], [subLevel])
```

Arguments:
- `name`: cstring, may be nil
- `drawLayer`: DrawLayer, may be nil
- `templateName`: cstring, may be nil
- `subLevel`: number, may be nil

Returns:
- `texture`: SimpleTexture

### CreateVectorGraphics

```lua
vectorGraphics = self:CreateVectorGraphics([name], [drawLayer], [templateName], [subLevel])
```

Arguments:
- `name`: cstring, may be nil
- `drawLayer`: DrawLayer, may be nil
- `templateName`: cstring, may be nil
- `subLevel`: number, may be nil

Returns:
- `vectorGraphics`: SimpleVectorGraphics

### DesaturateHierarchy

```lua
self:DesaturateHierarchy(desaturation, [excludeRoot])
```

Arguments:
- `desaturation`: number
- `excludeRoot`: bool, default false

### DisableDrawLayer

```lua
self:DisableDrawLayer(layer)
```

Arguments:
- `layer`: DrawLayer

### DoesClipChildren

```lua
clipsChildren = self:DoesClipChildren()
```

Returns:
- `clipsChildren`: bool

### DoesHyperlinkPropagateToParent

```lua
canPropagate = self:DoesHyperlinkPropagateToParent()
```

Returns whether hyperlink events (ex. OnHyperlinkEnter, OnHyperlinkLeave, OnHyperlinkClick) are propagated to this frame's parent.

Returns:
- `canPropagate`: bool

### EnableDrawLayer

```lua
self:EnableDrawLayer(layer)
```

Arguments:
- `layer`: DrawLayer

### EnableGamePadButton

```lua
self:EnableGamePadButton([enable])
```

Protected: only Blizzard's own code may call it.

Arguments:
- `enable`: bool, default false

### EnableGamePadStick

```lua
self:EnableGamePadStick([enable])
```

Protected: only Blizzard's own code may call it.

Arguments:
- `enable`: bool, default false

### EnableKeyboard

```lua
self:EnableKeyboard([enable])
```

Protected: only Blizzard's own code may call it.

Arguments:
- `enable`: bool, default false

### ExecuteAttribute

```lua
success, returns = self:ExecuteAttribute(attributeName, [arguments])
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Arguments:
- `attributeName`: cstring
- `arguments`: cstring, may be nil

Returns:
- `success`: bool
- `returns`: cstring, may be nil

### GetAlpha

```lua
alpha = self:GetAlpha()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `alpha`: SingleColorValue

### GetAttribute

```lua
value = self:GetAttribute(attributeName)
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Arguments:
- `attributeName`: cstring

Returns:
- `value`: cstring

### GetBoundsRect

```lua
left, bottom, width, height = self:GetBoundsRect()
```

Returns:
- `left`: uiUnit
- `bottom`: uiUnit
- `width`: uiUnit
- `height`: uiUnit

### GetChildren

```lua
children = self:GetChildren()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `children`: SimpleFrame

### GetClampRectInsets

```lua
left, right, top, bottom = self:GetClampRectInsets()
```

Returns:
- `left`: uiUnit
- `right`: uiUnit
- `top`: uiUnit
- `bottom`: uiUnit

### GetDontSavePosition

```lua
dontSave = self:GetDontSavePosition()
```

Returns:
- `dontSave`: bool

### GetEffectiveAlpha

```lua
effectiveAlpha = self:GetEffectiveAlpha()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `effectiveAlpha`: SingleColorValue

### GetEffectiveScale

```lua
effectiveScale = self:GetEffectiveScale()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `effectiveScale`: number

### GetEffectivelyFlattensRenderLayers

```lua
flatten = self:GetEffectivelyFlattensRenderLayers()
```

Returns:
- `flatten`: bool

### GetFlattensRenderLayers

```lua
flatten = self:GetFlattensRenderLayers()
```

Returns:
- `flatten`: bool

### GetFrameLevel

```lua
frameLevel = self:GetFrameLevel()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `frameLevel`: number

### GetFrameStrata

```lua
strata = self:GetFrameStrata()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `strata`: FrameStrata

### GetHighestFrameLevel

```lua
frameLevel = self:GetHighestFrameLevel([iterateAllChildren])
```

Returns the highest framelevel of the frame and its first order children, or all children if iterateAllChildren is true.

Arguments:
- `iterateAllChildren`: bool, default false

Returns:
- `frameLevel`: number

### GetHitRectInsets

```lua
left, right, top, bottom = self:GetHitRectInsets()
```

Returns:
- `left`: uiUnit
- `right`: uiUnit
- `top`: uiUnit
- `bottom`: uiUnit

### GetHyperlinksEnabled

```lua
enabled = self:GetHyperlinksEnabled()
```

Returns:
- `enabled`: bool

### GetID

```lua
id = self:GetID()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `id`: number

### GetNumChildren

```lua
numChildren = self:GetNumChildren()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `numChildren`: number

### GetNumRegions

```lua
numRegions = self:GetNumRegions()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `numRegions`: number

### GetOnUpdateMode

```lua
onUpdateMode = self:GetOnUpdateMode()
```

Returns the currently configured OnUpdate script execution mode.

Returns:
- `onUpdateMode`: OnUpdateMode

### GetPropagateKeyboardInput

```lua
propagate = self:GetPropagateKeyboardInput()
```

Returns:
- `propagate`: bool

### GetRaisedFrameLevel

```lua
frameLevel = self:GetRaisedFrameLevel()
```

Returns:
- `frameLevel`: number

### GetRegions

```lua
regions = self:GetRegions()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `regions`: SimpleRegion

### GetResizeBounds

```lua
minWidth, minHeight, maxWidth, maxHeight = self:GetResizeBounds()
```

Returns:
- `minWidth`: uiUnit
- `minHeight`: uiUnit
- `maxWidth`: uiUnit
- `maxHeight`: uiUnit

### GetRolesetNames

```lua
rolesets = self:GetRolesetNames()
```

Returns the roleset tags assigned to this frame. Returns a list containing 'roleless' if none are assigned.

Returns:
- `rolesets`: string[]

### GetScale

```lua
frameScale = self:GetScale()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `frameScale`: number

### GetWindow

```lua
window = self:GetWindow()
```

Returns:
- `window`: SimpleWindow

### HasAlphaGradient

```lua
hasAlphaGradient = self:HasAlphaGradient()
```

Returns:
- `hasAlphaGradient`: bool

### HasFixedFrameLevel

```lua
isFixed = self:HasFixedFrameLevel()
```

Returns:
- `isFixed`: bool

### HasFixedFrameStrata

```lua
isFixed = self:HasFixedFrameStrata()
```

Returns:
- `isFixed`: bool

### Hide

```lua
self:Hide()
```

Protected: only Blizzard's own code may call it.

### InterceptStartDrag

```lua
success = self:InterceptStartDrag(delegate)
```

Arguments:
- `delegate`: SimpleFrame

Returns:
- `success`: bool

### IsClampedToScreen

```lua
clampedToScreen = self:IsClampedToScreen()
```

Returns:
- `clampedToScreen`: bool

### IsDrawLayerEnabled

```lua
isEnabled = self:IsDrawLayerEnabled(layer)
```

Arguments:
- `layer`: DrawLayer

Returns:
- `isEnabled`: bool

### IsEventRegistered

```lua
isRegistered, units = self:IsEventRegistered(eventName)
```

Arguments:
- `eventName`: cstring

Returns:
- `isRegistered`: bool
- `units`: UnitTokenType, may be nil

### IsFrameBuffer

```lua
isFrameBuffer = self:IsFrameBuffer()
```

Returns:
- `isFrameBuffer`: bool

### IsGamePadButtonEnabled

```lua
enabled = self:IsGamePadButtonEnabled()
```

Returns:
- `enabled`: bool

### IsGamePadStickEnabled

```lua
enabled = self:IsGamePadStickEnabled()
```

Returns:
- `enabled`: bool

### IsHighlightLocked

```lua
locked = self:IsHighlightLocked()
```

Returns:
- `locked`: bool

### IsIgnoringChildrenForBounds

```lua
ignore = self:IsIgnoringChildrenForBounds()
```

Returns:
- `ignore`: bool

### IsIgnoringParentAlpha

```lua
ignore = self:IsIgnoringParentAlpha()
```

Returns:
- `ignore`: bool

### IsIgnoringParentScale

```lua
ignore = self:IsIgnoringParentScale()
```

Returns:
- `ignore`: bool

### IsKeyboardEnabled

```lua
enabled = self:IsKeyboardEnabled()
```

Returns:
- `enabled`: bool

### IsMovable

```lua
isMovable = self:IsMovable()
```

Returns:
- `isMovable`: bool

### IsObjectLoaded

```lua
isLoaded = self:IsObjectLoaded()
```

Returns:
- `isLoaded`: bool

### IsResizable

```lua
resizable = self:IsResizable()
```

Returns:
- `resizable`: bool

### IsRolesetFiltered

```lua
isRolesetFiltered = self:IsRolesetFiltered()
```

Returns whether this frame is hidden because of its rolesets being filtered.

Returns:
- `isRolesetFiltered`: bool

### IsShown

```lua
isShown = self:IsShown()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `isShown`: bool

### IsToplevel

```lua
isTopLevel = self:IsToplevel()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `isTopLevel`: bool

### IsUserPlaced

```lua
isUserPlaced = self:IsUserPlaced()
```

Returns:
- `isUserPlaced`: bool

### IsUsingParentLevel

```lua
usingParentLevel = self:IsUsingParentLevel()
```

Returns:
- `usingParentLevel`: bool

### IsVisible

```lua
isVisible = self:IsVisible()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `isVisible`: bool

### LockHighlight

```lua
self:LockHighlight()
```

### Lower

```lua
self:Lower()
```

Protected: only Blizzard's own code may call it.

### Raise

```lua
self:Raise()
```

Protected: only Blizzard's own code may call it.

### RegisterAllEvents

```lua
self:RegisterAllEvents()
```

### RegisterEvent

```lua
registered = self:RegisterEvent(eventName)
```

Arguments:
- `eventName`: cstring

Returns:
- `registered`: bool

### RegisterEventCallback

```lua
registered = self:RegisterEventCallback(eventName, cb)
```

Arguments:
- `eventName`: cstring
- `cb`: FrameEventCallbackType

Returns:
- `registered`: bool

### RegisterForDrag

```lua
self:RegisterForDrag(buttons)
```

Arguments:
- `buttons`: MouseButton

### RegisterUnitEvent

```lua
registered = self:RegisterUnitEvent(eventName, units)
```

Arguments:
- `eventName`: cstring
- `units`: UnitTokenType

Returns:
- `registered`: bool

### RegisterUnitEventCallback

```lua
registered = self:RegisterUnitEventCallback(eventName, cb, units)
```

Arguments:
- `eventName`: cstring
- `cb`: FrameEventCallbackType
- `units`: UnitTokenType

Returns:
- `registered`: bool

### RemoveRoleset

```lua
self:RemoveRoleset(roleset)
```

Removes a roleset tag from this frame.

Protected: only Blizzard's own code may call it.

Arguments:
- `roleset`: string

### ResizeToBoundsRect

```lua
self:ResizeToBoundsRect()
```

Protected: only Blizzard's own code may call it.

### RotateTextures

```lua
self:RotateTextures(radians, [x], [y])
```

Arguments:
- `radians`: number
- `x`: number, default 0.5
- `y`: number, default 0.5

### SetAlpha

```lua
self:SetAlpha(alpha)
```

Arguments:
- `alpha`: SingleColorValue

### SetAlphaFromBoolean

```lua
self:SetAlphaFromBoolean(value, [alphaIfTrue], [alphaIfFalse])
```

Arguments:
- `value`: bool
- `alphaIfTrue`: SingleColorValue, default 255
- `alphaIfFalse`: SingleColorValue, default 0

### SetAlphaGradient

```lua
self:SetAlphaGradient(index, gradient)
```

Arguments:
- `index`: number
- `gradient`: vector2

### SetAttribute

```lua
self:SetAttribute(attributeName, value)
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Arguments:
- `attributeName`: cstring
- `value`: cstring

### SetAttributeNoHandler

```lua
self:SetAttributeNoHandler(attributeName, value)
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Arguments:
- `attributeName`: cstring
- `value`: cstring

### SetClampRectInsets

```lua
self:SetClampRectInsets(left, right, top, bottom)
```

Protected: only Blizzard's own code may call it.

Arguments:
- `left`: uiUnit
- `right`: uiUnit
- `top`: uiUnit
- `bottom`: uiUnit

### SetClampedToScreen

```lua
self:SetClampedToScreen(clampedToScreen)
```

Protected: only Blizzard's own code may call it.

Arguments:
- `clampedToScreen`: bool

### SetClipsChildren

```lua
self:SetClipsChildren(clipsChildren)
```

Arguments:
- `clipsChildren`: bool

### SetDontSavePosition

```lua
self:SetDontSavePosition(dontSave)
```

Arguments:
- `dontSave`: bool

### SetDrawLayerEnabled

```lua
self:SetDrawLayerEnabled(layer, [isEnabled])
```

Arguments:
- `layer`: DrawLayer
- `isEnabled`: bool, default false

### SetFixedFrameLevel

```lua
self:SetFixedFrameLevel(isFixed)
```

Protected: only Blizzard's own code may call it.

Arguments:
- `isFixed`: bool

### SetFixedFrameStrata

```lua
self:SetFixedFrameStrata(isFixed)
```

Protected: only Blizzard's own code may call it.

Arguments:
- `isFixed`: bool

### SetFlattensRenderLayers

```lua
self:SetFlattensRenderLayers(flatten)
```

Arguments:
- `flatten`: bool

### SetFrameLevel

```lua
self:SetFrameLevel(frameLevel)
```

Protected: only Blizzard's own code may call it.

Arguments:
- `frameLevel`: number

### SetFrameStrata

```lua
self:SetFrameStrata(strata)
```

Protected: only Blizzard's own code may call it.

Arguments:
- `strata`: FrameStrata

### SetHighlightLocked

```lua
self:SetHighlightLocked(locked)
```

Arguments:
- `locked`: bool

### SetHitRectInsets

```lua
self:SetHitRectInsets(left, right, top, bottom)
```

Protected: only Blizzard's own code may call it.

Arguments:
- `left`: uiUnit
- `right`: uiUnit
- `top`: uiUnit
- `bottom`: uiUnit

### SetHyperlinkPropagateToParent

```lua
self:SetHyperlinkPropagateToParent(canPropagate)
```

Enables or disables propagating hyperlink events (ex. OnHyperlinkEnter, OnHyperlinkLeave, OnHyperlinkClick) to this frame's parent.

Arguments:
- `canPropagate`: bool

### SetHyperlinksEnabled

```lua
self:SetHyperlinksEnabled([enabled])
```

Protected: only Blizzard's own code may call it.

Arguments:
- `enabled`: bool, default false

### SetID

```lua
self:SetID(id)
```

Protected: only Blizzard's own code may call it.

Arguments:
- `id`: number

### SetIgnoreParentAlpha

```lua
self:SetIgnoreParentAlpha(ignore)
```

Arguments:
- `ignore`: bool

### SetIgnoreParentScale

```lua
self:SetIgnoreParentScale(ignore)
```

Protected: only Blizzard's own code may call it.

Arguments:
- `ignore`: bool

### SetIgnoringChildrenForBounds

```lua
self:SetIgnoringChildrenForBounds(ignore)
```

Arguments:
- `ignore`: bool

### SetIsFrameBuffer

```lua
self:SetIsFrameBuffer(isFrameBuffer)
```

Arguments:
- `isFrameBuffer`: bool

### SetMovable

```lua
self:SetMovable(movable)
```

Arguments:
- `movable`: bool

### SetOnUpdateMode

```lua
self:SetOnUpdateMode(onUpdateMode)
```

Changes when OnUpdate scripts are executed for this object.

Arguments:
- `onUpdateMode`: OnUpdateMode

### SetPropagateKeyboardInput

```lua
self:SetPropagateKeyboardInput(propagate)
```

Arguments:
- `propagate`: bool

### SetResizable

```lua
self:SetResizable(resizable)
```

Arguments:
- `resizable`: bool

### SetResizeBounds

```lua
self:SetResizeBounds(minWidth, minHeight, [maxWidth], [maxHeight])
```

Arguments:
- `minWidth`: uiUnit
- `minHeight`: uiUnit
- `maxWidth`: uiUnit, may be nil
- `maxHeight`: uiUnit, may be nil

### SetRolesets

```lua
self:SetRolesets([rolesetsString])
```

Sets the roleset tags for this frame, used by the UI mode system to gate visibility. Supports comma-separated names to assign multiple rolesets. Pass nil to clear.

Protected: only Blizzard's own code may call it.

Arguments:
- `rolesetsString`: cstring, may be nil

### SetScale

```lua
self:SetScale(scale)
```

Protected: only Blizzard's own code may call it.

Arguments:
- `scale`: number

### SetShown

```lua
self:SetShown([shown])
```

Protected: only Blizzard's own code may call it.

Arguments:
- `shown`: bool, default false

### SetToplevel

```lua
self:SetToplevel(topLevel)
```

Protected: only Blizzard's own code may call it.

Arguments:
- `topLevel`: bool

### SetUserPlaced

```lua
self:SetUserPlaced(userPlaced)
```

Arguments:
- `userPlaced`: bool

### SetUsingParentLevel

```lua
self:SetUsingParentLevel(usingParentLevel)
```

Protected: only Blizzard's own code may call it.

Arguments:
- `usingParentLevel`: bool

### SetWindow

```lua
self:SetWindow([window])
```

Arguments:
- `window`: SimpleWindow, may be nil

### Show

```lua
self:Show()
```

Protected: only Blizzard's own code may call it.

### StartMoving

```lua
self:StartMoving([alwaysStartFromMouse])
```

Protected: only Blizzard's own code may call it.

Arguments:
- `alwaysStartFromMouse`: bool, default false

### StartSizing

```lua
self:StartSizing([resizePoint], [alwaysStartFromMouse])
```

Protected: only Blizzard's own code may call it.

Arguments:
- `resizePoint`: FramePoint, may be nil
- `alwaysStartFromMouse`: bool, default false

### StopMovingOrSizing

```lua
self:StopMovingOrSizing()
```

Protected: only Blizzard's own code may call it.

### UnlockHighlight

```lua
self:UnlockHighlight()
```

### UnregisterAllEvents

```lua
self:UnregisterAllEvents()
```

### UnregisterEvent

```lua
registered = self:UnregisterEvent(eventName)
```

Arguments:
- `eventName`: cstring

Returns:
- `registered`: bool

## Tables

### CreateRegionParams (structure)

- `name`: cstring, may be nil
- `drawLayer`: DrawLayer, may be nil
- `templateName`: cstring, may be nil
- `subLevel`: number, may be nil

### FrameEventCallbackType (callbacktype)

---
Make an addon with your AI: tell it "Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it."
