Compare commits

..

3 Commits

Author SHA1 Message Date
87d373fb42 Update 2025-05-04 22:57:31 +02:00
3336a6387e Update 2025-05-04 22:50:42 +02:00
78355b4770 Update 2025-05-04 22:08:49 +02:00
16 changed files with 1298 additions and 124 deletions

95
ui/Button.lua Normal file
View File

@@ -0,0 +1,95 @@
---@meta
---@class Button : Frame
Button = {
--- Clicks the button programmatically.
--- @param button? string Optional. The mouse button to simulate ("LeftButton", "RightButton", "MiddleButton").
--- @param down? boolean Optional. Whether the button is being pressed down.
--- @example
--- myButton:Click()
Click = function(self, button, down) end,
--- Gets the button state.
--- @return string state The button state ("PUSHED", "NORMAL").
--- @example
--- local state = myButton:GetButtonState()
GetButtonState = function(self) end,
--- Gets the text displayed on the button.
--- @return string text The button text.
--- @example
--- local text = myButton:GetText()
GetText = function(self) end,
--- Gets the texture for the specified state.
--- @param stateIndex number The state index.
--- @return Texture texture The state texture.
--- @example
--- local texture = myButton:GetTextureStateTexture(1)
GetTextureStateTexture = function(self, stateIndex) end,
--- Enables or disables the button.
--- @param enabled boolean True to enable the button.
--- @example
--- myButton:Enable()
Enable = function(self, enabled) end,
--- Disables the button.
--- @example
--- myButton:Disable()
Disable = function(self) end,
--- Returns whether the button is enabled.
--- @return boolean enabled True if the button is enabled.
--- @example
--- local enabled = myButton:IsEnabled()
IsEnabled = function(self) end,
--- Sets whether the button is locked.
--- @param locked boolean True to lock the button.
--- @example
--- myButton:LockHighlight(true)
LockHighlight = function(self, locked) end,
--- Registers the button for drag events.
--- @param ... string The mouse buttons to register ("LeftButton", "RightButton", "MiddleButton").
--- @example
--- myButton:RegisterForDrag("LeftButton", "RightButton")
RegisterForDrag = function(self, ...) end,
--- Sets the button state.
--- @param state string The state to set ("PUSHED", "NORMAL").
--- @example
--- myButton:SetButtonState("PUSHED")
SetButtonState = function(self, state) end,
--- Sets whether the button is enabled.
--- @param enabled boolean True to enable the button.
--- @example
--- myButton:SetEnabled(true)
SetEnabled = function(self, enabled) end,
--- Sets the font string used for the button text.
--- @param fontString FontString The font string to use.
--- @example
--- myButton:SetFontString(myFontString)
SetFontString = function(self, fontString) end,
--- Sets the button text.
--- @param text string The text to display.
--- @example
--- myButton:SetText("Click Me")
SetText = function(self, text) end,
--- Sets the texture for a button state.
--- @param texture Texture|string The texture or texture path.
--- @param stateIndex number The state index.
--- @example
--- myButton:SetTextureStateTexture(myTexture, 1)
SetTextureStateTexture = function(self, texture, stateIndex) end,
--- Unlocks the button highlight.
--- @example
--- myButton:UnlockHighlight()
UnlockHighlight = function(self) end,
}

40
ui/CheckButton.lua Normal file
View File

@@ -0,0 +1,40 @@
---@meta
---@class CheckButton : Button
CheckButton = {
--- Gets the checked state of the checkbox.
--- @return boolean checked True if the checkbox is checked.
--- @example
--- local checked = myCheckButton:GetChecked()
GetChecked = function(self) end,
--- Gets the texture used for a checked box.
--- @return Texture texture The checked texture.
--- @example
--- local texture = myCheckButton:GetCheckedTexture()
GetCheckedTexture = function(self) end,
--- Gets the texture used for a disabled checked box.
--- @return Texture texture The disabled checked texture.
--- @example
--- local texture = myCheckButton:GetDisabledCheckedTexture()
GetDisabledCheckedTexture = function(self) end,
--- Sets the checked state of the checkbox.
--- @param checked boolean True to check the checkbox.
--- @example
--- myCheckButton:SetChecked(true)
SetChecked = function(self, checked) end,
--- Sets the texture to use for a checked box.
--- @param texture Texture|string The texture or texture path.
--- @example
--- myCheckButton:SetCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check")
SetCheckedTexture = function(self, texture) end,
--- Sets the texture to use for a disabled checked box.
--- @param texture Texture|string The texture or texture path.
--- @example
--- myCheckButton:SetDisabledCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check-Disabled")
SetDisabledCheckedTexture = function(self, texture) end,
}

179
ui/EditBox.lua Normal file
View File

@@ -0,0 +1,179 @@
---@meta
---@class EditBox : Frame, FontInstance
EditBox = {
--- Adds a history line to the edit box.
--- @param text string The text to add to history.
--- @example
--- myEditBox:AddHistoryLine("Previous entry")
AddHistoryLine = function(self, text) end,
--- Clears the focus from the edit box.
--- @example
--- myEditBox:ClearFocus()
ClearFocus = function(self) end,
--- Clears the history of the edit box.
--- @example
--- myEditBox:ClearHistory()
ClearHistory = function(self) end,
--- Gets the cursor position.
--- @return number position The cursor position.
--- @example
--- local position = myEditBox:GetCursorPosition()
GetCursorPosition = function(self) end,
--- Gets the maximum number of bytes allowed.
--- @return number maxBytes The maximum number of bytes.
--- @example
--- local maxBytes = myEditBox:GetMaxBytes()
GetMaxBytes = function(self) end,
--- Gets the maximum number of characters allowed.
--- @return number maxLetters The maximum number of characters.
--- @example
--- local maxLetters = myEditBox:GetMaxLetters()
GetMaxLetters = function(self) end,
--- Gets the maximum number of history lines.
--- @return number maxLines The maximum number of history lines.
--- @example
--- local maxLines = myEditBox:GetMaxLines()
GetMaxLines = function(self) end,
--- Gets the number of history lines.
--- @return number numLines The number of history lines.
--- @example
--- local numLines = myEditBox:GetNumHistory()
GetNumHistory = function(self) end,
--- Gets the numeric value of the edit box text.
--- @return number number The numeric value.
--- @example
--- local number = myEditBox:GetNumber()
GetNumber = function(self) end,
--- Gets the text displayed in the edit box.
--- @return string text The edit box text.
--- @example
--- local text = myEditBox:GetText()
GetText = function(self) end,
--- Gets the text insets.
--- @return number left, number right, number top, number bottom The inset values.
--- @example
--- local left, right, top, bottom = myEditBox:GetTextInsets()
GetTextInsets = function(self) end,
--- Highlights the text in the edit box.
--- @param start number The starting position.
--- @param end_ number The ending position.
--- @example
--- myEditBox:HighlightText(0, 5)
HighlightText = function(self, start, end_) end,
--- Inserts text at the cursor position.
--- @param text string The text to insert.
--- @example
--- myEditBox:Insert("New text")
Insert = function(self, text) end,
--- Returns whether the edit box has focus.
--- @return boolean hasFocus True if the edit box has focus.
--- @example
--- local hasFocus = myEditBox:HasFocus()
HasFocus = function(self) end,
--- Returns whether the text is highlighted.
--- @return boolean isHighlighted True if text is highlighted.
--- @example
--- local isHighlighted = myEditBox:IsHighlighted()
IsHighlighted = function(self) end,
--- Returns whether the edit box is in numeric mode.
--- @return boolean isNumeric True if in numeric mode.
--- @example
--- local isNumeric = myEditBox:IsNumeric()
IsNumeric = function(self) end,
--- Returns whether the edit box is password input.
--- @return boolean isPassword True if password input.
--- @example
--- local isPassword = myEditBox:IsPassword()
IsPassword = function(self) end,
--- Sets the cursor position.
--- @param position number The cursor position.
--- @example
--- myEditBox:SetCursorPosition(5)
SetCursorPosition = function(self, position) end,
--- Sets whether the edit box has focus.
--- @param focus boolean True to set focus.
--- @example
--- myEditBox:SetFocus(true)
SetFocus = function(self, focus) end,
--- Sets the history lines.
--- @param ... string The history lines.
--- @example
--- myEditBox:SetHistoryLines("Line 1", "Line 2")
SetHistoryLines = function(self, ...) end,
--- Sets the maximum number of bytes allowed.
--- @param maxBytes number The maximum number of bytes.
--- @example
--- myEditBox:SetMaxBytes(256)
SetMaxBytes = function(self, maxBytes) end,
--- Sets the maximum number of characters allowed.
--- @param maxLetters number The maximum number of characters.
--- @example
--- myEditBox:SetMaxLetters(50)
SetMaxLetters = function(self, maxLetters) end,
--- Sets the maximum number of history lines.
--- @param maxLines number The maximum number of history lines.
--- @example
--- myEditBox:SetMaxLines(100)
SetMaxLines = function(self, maxLines) end,
--- Sets whether the edit box is in numeric mode.
--- @param isNumeric boolean True to set numeric mode.
--- @example
--- myEditBox:SetNumeric(true)
SetNumeric = function(self, isNumeric) end,
--- Sets whether the edit box is password input.
--- @param isPassword boolean True to set password input.
--- @example
--- myEditBox:SetPassword(true)
SetPassword = function(self, isPassword) end,
--- Sets the text displayed in the edit box.
--- @param text string The text to display.
--- @example
--- myEditBox:SetText("New text")
SetText = function(self, text) end,
--- Sets the text insets.
--- @param left number The left inset.
--- @param right number The right inset.
--- @param top number The top inset.
--- @param bottom number The bottom inset.
--- @example
--- myEditBox:SetTextInsets(5, 5, 2, 2)
SetTextInsets = function(self, left, right, top, bottom) end,
--- Sets whether the edit box text can be changed.
--- @param enabled boolean True to enable text changes.
--- @example
--- myEditBox:SetEnabled(true)
SetEnabled = function(self, enabled) end,
--- Toggles whether the edit box has focus.
--- @example
--- myEditBox:ToggleInputLanguage()
ToggleInputLanguage = function(self) end,
}

109
ui/FontInstance.lua Normal file
View File

@@ -0,0 +1,109 @@
---@meta
---@class FontInstance
FontInstance = {
--- Gets the font properties.
--- @return string fontFile, number height, string flags
--- @example
--- local fontFile, height, flags = myFontInstance:GetFont()
GetFont = function(self) end,
--- Gets the font object.
--- @return FontObject fontObject The font object.
--- @example
--- local fontObject = myFontInstance:GetFontObject()
GetFontObject = function(self) end,
--- Gets the horizontal text alignment.
--- @return string justifyH The horizontal alignment ("LEFT", "CENTER", "RIGHT").
--- @example
--- local justifyH = myFontInstance:GetJustifyH()
GetJustifyH = function(self) end,
--- Gets the vertical text alignment.
--- @return string justifyV The vertical alignment ("TOP", "MIDDLE", "BOTTOM").
--- @example
--- local justifyV = myFontInstance:GetJustifyV()
GetJustifyV = function(self) end,
--- Gets the shadow color.
--- @return number r, number g, number b, number a The color components.
--- @example
--- local r, g, b, a = myFontInstance:GetShadowColor()
GetShadowColor = function(self) end,
--- Gets the shadow offset.
--- @return number x, number y The shadow offset.
--- @example
--- local x, y = myFontInstance:GetShadowOffset()
GetShadowOffset = function(self) end,
--- Gets the spacing between lines.
--- @return number spacing The line spacing.
--- @example
--- local spacing = myFontInstance:GetSpacing()
GetSpacing = function(self) end,
--- Gets the text color.
--- @return number r, number g, number b, number a The color components.
--- @example
--- local r, g, b, a = myFontInstance:GetTextColor()
GetTextColor = function(self) end,
--- Sets the font properties.
--- @param fontFile string The path to the font file.
--- @param height number The font height.
--- @param flags string? Optional. The font flags.
--- @example
--- myFontInstance:SetFont("Fonts\\FRIZQT__.TTF", 12, "OUTLINE")
SetFont = function(self, fontFile, height, flags) end,
--- Sets the font object.
--- @param fontObject FontObject The font object to use.
--- @example
--- myFontInstance:SetFontObject(GameFontNormal)
SetFontObject = function(self, fontObject) end,
--- Sets the horizontal text alignment.
--- @param justifyH string The horizontal alignment ("LEFT", "CENTER", "RIGHT").
--- @example
--- myFontInstance:SetJustifyH("CENTER")
SetJustifyH = function(self, justifyH) end,
--- Sets the vertical text alignment.
--- @param justifyV string The vertical alignment ("TOP", "MIDDLE", "BOTTOM").
--- @example
--- myFontInstance:SetJustifyV("MIDDLE")
SetJustifyV = function(self, justifyV) end,
--- Sets the shadow color.
--- @param r number The red component.
--- @param g number The green component.
--- @param b number The blue component.
--- @param a number? Optional. The alpha component.
--- @example
--- myFontInstance:SetShadowColor(0, 0, 0, 1)
SetShadowColor = function(self, r, g, b, a) end,
--- Sets the shadow offset.
--- @param x number The horizontal offset.
--- @param y number The vertical offset.
--- @example
--- myFontInstance:SetShadowOffset(1, -1)
SetShadowOffset = function(self, x, y) end,
--- Sets the spacing between lines.
--- @param spacing number The line spacing.
--- @example
--- myFontInstance:SetSpacing(2)
SetSpacing = function(self, spacing) end,
--- Sets the text color.
--- @param r number The red component.
--- @param g number The green component.
--- @param b number The blue component.
--- @param a number? Optional. The alpha component.
--- @example
--- myFontInstance:SetTextColor(1, 1, 1, 1)
SetTextColor = function(self, r, g, b, a) end,
}

View File

@@ -6,7 +6,7 @@
---@field top number
---@field bottom number
---@class FontString : UIObject, Region, ScriptRegion
---@class FontString : Region, FontInstance
FontString = {
--- Returns localized text depending on the specified gender.
--- @param self FontString
@@ -304,3 +304,31 @@ FontString = {
--- myFontString:SetWordWrap(true)
SetWordWrap = function(self, wrap) end,
}
---@alias FontObject
---| 'GameFontNormal'
---| 'GameFontNormalSmall'
---| 'GameFontNormalLarge'
---| 'GameFontHighlight'
---| 'GameFontHighlightSmall'
---| 'GameFontHighlightSmallOutline'
---| 'GameFontHighlightLarge'
---| 'GameFontDisable'
---| 'GameFontDisableSmall'
---| 'GameFontDisableLarge'
---| 'GameFontGreen'
---| 'GameFontGreenSmall'
---| 'GameFontGreenLarge'
---| 'GameFontRed'
---| 'GameFontRedSmall'
---| 'GameFontRedLarge'
---| 'GameFontWhite'
---| 'GameFontDarkGraySmall'
---| 'NumberFontNormalYellow'
---| 'NumberFontNormalSmallGray'
---| 'QuestFontNormalSmall'
---| 'DialogButtonHighlightText'
---| 'ErrorFont'
---| 'TextStatusBarText'
---| 'CombatLogFont'
---| string

View File

@@ -13,14 +13,14 @@ Frame = {
--- local canChange = myFrame:CanChangeAttribute()
CanChangeAttribute = function(self) end,
--- Creates a fontstring.
--- @param name string? Optional. The name of the fontstring.
--- @param drawLayer string? Optional. The layer to draw the fontstring.
--- @param templateName string? Optional. The name of a template to use.
--- @return FontString The created fontstring.
--- Creates and returns a FontString as a child of this Frame.
--- @param name string? Optional. The name of the FontString.
--- @param layer string? Optional. The layer of the FontString.
--- @param inheritsFrom string? Optional. The name of the FontString to inherit from.
--- @return FontString fontString The created FontString.
--- @example
--- local fontString = myFrame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
CreateFontString = function(self, name, drawLayer, templateName) end,
--- local myFontString = myFrame:CreateFontString("MyFontString", "OVERLAY")
CreateFontString = function(self, name, layer, inheritsFrom) end,
--- Draws a line.
--- @param name string? Optional. The name of the line.
@@ -42,15 +42,14 @@ Frame = {
--- local maskTexture = myFrame:CreateMaskTexture(nil, "OVERLAY", "MaskTemplate")
CreateMaskTexture = function(self, name, drawLayer, templateName, subLevel) end,
--- Creates a texture.
--- @param name string? Optional. The name of the texture.
--- @param drawLayer string? Optional. The layer to draw the texture.
--- @param templateName string? Optional. The name of a template to use.
--- @param subLevel number? Optional. The sublevel of the texture.
--- @return Texture The created texture.
--- Creates and returns a Texture as a child of this Frame.
--- @param name string? Optional. The name of the Texture.
--- @param layer string? Optional. The layer of the Texture.
--- @param inheritsFrom string? Optional. The name of the Texture to inherit from.
--- @return Texture texture The created Texture.
--- @example
--- local texture = myFrame:CreateTexture(nil, "BACKGROUND", "TextureTemplate")
CreateTexture = function(self, name, drawLayer, templateName, subLevel) end,
--- local myTexture = myFrame:CreateTexture("MyTexture", "BACKGROUND")
CreateTexture = function(self, name, layer, inheritsFrom) end,
--- Disables drawing on the specified layer.
--- @param layer string The layer to disable.
@@ -76,12 +75,12 @@ Frame = {
--- local id = myFrame:GetID()
GetID = function(self) end,
--- Shows the frame.
--- Shows this object (it will appear if its parent is visible).
--- @example
--- myFrame:Show()
Show = function(self) end,
--- Hides the frame.
--- Hides this object (it and all of its children will disappear).
--- @example
--- myFrame:Hide()
Hide = function(self) end,
@@ -103,15 +102,15 @@ Frame = {
SetMovable = function(self, movable) end,
--- Sets the frame's level.
--- @param frameLevel number The level to set.
--- @param level number The level to set.
--- @example
--- myFrame:SetFrameLevel(5)
SetFrameLevel = function(self, frameLevel) end,
SetFrameLevel = function(self, level) end,
--- Sets the frame's strata.
--- @param strata string The strata to set.
--- @param strata string The strata to set (e.g., "BACKGROUND", "MEDIUM", "HIGH").
--- @example
--- myFrame:SetFrameStrata("DIALOG")
--- myFrame:SetFrameStrata("HIGH")
SetFrameStrata = function(self, strata) end,
--- Registers the frame for a specific event.
@@ -125,4 +124,71 @@ Frame = {
--- @example
--- myFrame:UnregisterEvent("PLAYER_LOGIN")
UnregisterEvent = function(self, eventName) end,
--- Sets the backdrop of the frame according to the specification provided.
--- @param backdropTable table? Optional. A table defining the backdrop.
--- @example
--- myFrame:SetBackdrop({bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background"})
SetBackdrop = function(self, backdropTable) end,
--- Sets the frame's backdrop color.
--- @param r number The red component of the color.
--- @param g number The green component of the color.
--- @param b number The blue component of the color.
--- @param a number? Optional. The alpha component of the color.
--- @example
--- myFrame:SetBackdropColor(0, 0, 0, 0.5) -- Set to semi-transparent black
SetBackdropColor = function(self, r, g, b, a) end,
--- Sets the frame's backdrop border color.
--- @param r number The red component of the border color.
--- @param g number The green component of the border color.
--- @param b number The blue component of the border color.
--- @param a number? Optional. The alpha component of the border color.
--- @example
--- myFrame:SetBackdropBorderColor(1, 1, 1) -- Set to white
SetBackdropBorderColor = function(self, r, g, b, a) end,
--- Sets whether this frame will get keyboard input.
--- @param enableFlag boolean True to enable keyboard input.
--- @example
--- myFrame:EnableKeyboard(true)
EnableKeyboard = function(self, enableFlag) end,
--- Sets whether this frame will get mouse input.
--- @param enableFlag boolean True to enable mouse input.
--- @example
--- myFrame:EnableMouse(true)
EnableMouse = function(self, enableFlag) end,
--- Sets whether this frame will get mouse wheel notifications.
--- @param enableFlag boolean True to enable mouse wheel notifications.
--- @example
--- myFrame:EnableMouseWheel(true)
EnableMouseWheel = function(self, enableFlag) end,
--- Sets the height of the object.
--- @param height number The height to set.
--- @example
--- myFrame:SetHeight(200)
SetHeight = function(self, height) end,
--- Sets the width of the object.
--- @param width number The width to set.
--- @example
--- myFrame:SetWidth(300)
SetWidth = function(self, width) end,
--- Sets the size of the frame.
--- @param width number The width to set.
--- @param height number The height to set.
--- @example
--- myFrame:SetSize(300, 200)
SetSize = function(self, width, height) end,
--- Sets the parent for this frame.
--- @param parent Frame|string The parent frame or name of the parent frame.
--- @example
--- myFrame:SetParent(otherFrame)
SetParent = function(self, parent) end,
}

56
ui/MessageFrame.lua Normal file
View File

@@ -0,0 +1,56 @@
---@meta
---@class MessageFrame : Frame, FontInstance
MessageFrame = {
--- Adds a message to the frame.
--- @param text string The message text.
--- @param r? number Optional. The red color component.
--- @param g? number Optional. The green color component.
--- @param b? number Optional. The blue color component.
--- @param id? number Optional. A message identifier.
--- @param holdTime? number Optional. How long to display the message.
--- @example
--- myMessageFrame:AddMessage("Hello", 1, 0, 0)
AddMessage = function(self, text, r, g, b, id, holdTime) end,
--- Clears all messages from the frame.
--- @example
--- myMessageFrame:Clear()
Clear = function(self) end,
--- Gets the fade duration for messages.
--- @return number duration The fade duration in seconds.
--- @example
--- local duration = myMessageFrame:GetFadeDuration()
GetFadeDuration = function(self) end,
--- Gets whether fading is enabled.
--- @return boolean enabled True if fading is enabled.
--- @example
--- local enabled = myMessageFrame:GetFading()
GetFading = function(self) end,
--- Gets the time messages remain visible.
--- @return number time The time in seconds.
--- @example
--- local time = myMessageFrame:GetTimeVisible()
GetTimeVisible = function(self) end,
--- Sets the fade duration for messages.
--- @param duration number The fade duration in seconds.
--- @example
--- myMessageFrame:SetFadeDuration(0.3)
SetFadeDuration = function(self, duration) end,
--- Sets whether fading is enabled.
--- @param enabled boolean True to enable fading.
--- @example
--- myMessageFrame:SetFading(true)
SetFading = function(self, enabled) end,
--- Sets how long messages remain visible.
--- @param time number The time in seconds.
--- @example
--- myMessageFrame:SetTimeVisible(5)
SetTimeVisible = function(self, time) end,
}

16
ui/Object.lua Normal file
View File

@@ -0,0 +1,16 @@
---@meta
---@class Object
Object = {
--- Returns the name of the object.
--- @return string name The name of the object.
--- @example
--- local name = myObject:GetName()
GetName = function(self) end,
--- Returns the object's parent object.
--- @return Object parent The parent object.
--- @example
--- local parent = myObject:GetParent()
GetParent = function(self) end,
}

View File

@@ -1,7 +1,96 @@
---@meta
---@class Region : ScriptRegion
---@class Region : UIObject
Region = {
--- Gets the effective alpha (opacity) of the region.
--- @return number alpha The effective alpha value.
--- @example
--- local alpha = myRegion:GetEffectiveAlpha()
GetEffectiveAlpha = function(self) end,
--- Gets the height of the region.
--- @return number height The height in pixels.
--- @example
--- local height = myRegion:GetHeight()
GetHeight = function(self) end,
--- Gets the width of the region.
--- @return number width The width in pixels.
--- @example
--- local width = myRegion:GetWidth()
GetWidth = function(self) end,
--- Gets the region's numeric identifier.
--- @return number id The region's ID.
--- @example
--- local id = myRegion:GetID()
GetID = function(self) end,
--- Gets the number of points defined for the region.
--- @return number numPoints The number of points.
--- @example
--- local numPoints = myRegion:GetNumPoints()
GetNumPoints = function(self) end,
--- Gets the position and anchoring of the region at the specified point index.
--- @param pointIndex number The index of the point to query.
--- @return string point, Region relativeTo, string relativePoint, number xOffset, number yOffset
--- @example
--- local point, relativeTo, relativePoint, xOffset, yOffset = myRegion:GetPoint(1)
GetPoint = function(self, pointIndex) end,
--- Gets the scale factor of the region.
--- @return number scale The scale factor.
--- @example
--- local scale = myRegion:GetScale()
GetScale = function(self) end,
--- Sets the alpha (opacity) of the region.
--- @param alpha number The alpha value (0.0 to 1.0).
--- @example
--- myRegion:SetAlpha(0.5)
SetAlpha = function(self, alpha) end,
--- Sets the height of the region.
--- @param height number The height in pixels.
--- @example
--- myRegion:SetHeight(100)
SetHeight = function(self, height) end,
--- Sets the width of the region.
--- @param width number The width in pixels.
--- @example
--- myRegion:SetWidth(200)
SetWidth = function(self, width) end,
--- Sets both the width and height of the region.
--- @param width number The width in pixels.
--- @param height number The height in pixels.
--- @example
--- myRegion:SetSize(200, 100)
SetSize = function(self, width, height) end,
--- Sets the scale factor of the region.
--- @param scale number The scale factor.
--- @example
--- myRegion:SetScale(1.5)
SetScale = function(self, scale) end,
--- Clears all anchor points from the region.
--- @example
--- myRegion:ClearAllPoints()
ClearAllPoints = function(self) end,
--- Sets the position and anchoring of the region.
--- @param point string The point on this region to anchor from.
--- @param relativeTo Region|string The region or frameName to anchor to.
--- @param relativePoint string The point on the other region to anchor to.
--- @param xOffset number The x-axis offset.
--- @param yOffset number The y-axis offset.
--- @example
--- myRegion:SetPoint("TOPLEFT", otherRegion, "BOTTOMRIGHT", 10, -10)
SetPoint = function(self, point, relativeTo, relativePoint, xOffset, yOffset) end,
--- Returns the region's opacity.
--- @return number alpha The opacity of the region.
--- @example
@@ -21,12 +110,6 @@ Region = {
--- local effectiveScale = myRegion:GetEffectiveScale()
GetEffectiveScale = function(self) end,
--- Returns the scale of the region.
--- @return number scale The scale of the region.
--- @example
--- local scale = myRegion:GetScale()
GetScale = function(self) end,
--- Returns the vertex color shading of the region.
--- @return number colorR The red component of the vertex color.
--- @return number colorG The green component of the vertex color.
@@ -54,12 +137,6 @@ Region = {
--- local isLoaded = myRegion:IsObjectLoaded()
IsObjectLoaded = function(self) end,
--- Sets the opacity of the region.
--- @param alpha number The opacity value to set (0 to 1).
--- @example
--- myRegion:SetAlpha(0.5) -- Set to 50% opacity
SetAlpha = function(self, alpha) end,
--- Sets the layer in which the region is drawn.
--- @param layer string The layer to set.
--- @param sublevel number? Optional. The sublevel to set.
@@ -79,12 +156,6 @@ Region = {
--- myRegion:SetIgnoreParentScale(true)
SetIgnoreParentScale = function(self, ignore) end,
--- Sets the size scaling of the region.
--- @param scale number The scale value to set.
--- @example
--- myRegion:SetScale(1.5) -- Scale to 150%
SetScale = function(self, scale) end,
--- Sets the vertex shading color of the region.
--- @param colorR number The red component of the color.
--- @param colorG number The green component of the color.

57
ui/ScrollFrame.lua Normal file
View File

@@ -0,0 +1,57 @@
---@meta
---@class ScrollFrame : Frame
ScrollFrame = {
--- Gets the horizontal scroll range.
--- @return number range The horizontal scroll range.
--- @example
--- local range = myScrollFrame:GetHorizontalScrollRange()
GetHorizontalScrollRange = function(self) end,
--- Gets the current horizontal scroll position.
--- @return number position The horizontal scroll position.
--- @example
--- local position = myScrollFrame:GetHorizontalScroll()
GetHorizontalScroll = function(self) end,
--- Gets the vertical scroll range.
--- @return number range The vertical scroll range.
--- @example
--- local range = myScrollFrame:GetVerticalScrollRange()
GetVerticalScrollRange = function(self) end,
--- Gets the current vertical scroll position.
--- @return number position The vertical scroll position.
--- @example
--- local position = myScrollFrame:GetVerticalScroll()
GetVerticalScroll = function(self) end,
--- Gets the scrollable child frame.
--- @return Frame childFrame The scrollable child frame.
--- @example
--- local childFrame = myScrollFrame:GetScrollChild()
GetScrollChild = function(self) end,
--- Sets the horizontal scroll position.
--- @param position number The horizontal scroll position.
--- @example
--- myScrollFrame:SetHorizontalScroll(50)
SetHorizontalScroll = function(self, position) end,
--- Sets the vertical scroll position.
--- @param position number The vertical scroll position.
--- @example
--- myScrollFrame:SetVerticalScroll(50)
SetVerticalScroll = function(self, position) end,
--- Sets the scrollable child frame.
--- @param frame Frame The frame to set as the scrollable child.
--- @example
--- myScrollFrame:SetScrollChild(childFrame)
SetScrollChild = function(self, frame) end,
--- Updates the scroll range and position.
--- @example
--- myScrollFrame:UpdateScrollChildRect()
UpdateScrollChildRect = function(self) end,
}

View File

@@ -0,0 +1,125 @@
---@meta
---@class ScrollingMessageFrame : Frame, FontInstance
ScrollingMessageFrame = {
--- Adds a message to the frame.
--- @param text string The message text.
--- @param r? number Optional. The red color component.
--- @param g? number Optional. The green color component.
--- @param b? number Optional. The blue color component.
--- @param id? number Optional. A message identifier.
--- @param holdTime? number Optional. How long to display the message.
--- @example
--- myFrame:AddMessage("Hello", 1, 0, 0)
AddMessage = function(self, text, r, g, b, id, holdTime) end,
--- Clears all messages from the frame.
--- @example
--- myFrame:Clear()
Clear = function(self) end,
--- Gets the fade duration for messages.
--- @return number duration The fade duration in seconds.
--- @example
--- local duration = myFrame:GetFadeDuration()
GetFadeDuration = function(self) end,
--- Gets whether fading is enabled.
--- @return boolean enabled True if fading is enabled.
--- @example
--- local enabled = myFrame:GetFading()
GetFading = function(self) end,
--- Gets the time messages remain visible.
--- @return number time The time in seconds.
--- @example
--- local time = myFrame:GetTimeVisible()
GetTimeVisible = function(self) end,
--- Gets the current scroll offset.
--- @return number offset The scroll offset.
--- @example
--- local offset = myFrame:GetScrollOffset()
GetScrollOffset = function(self) end,
--- Gets the insert mode for new messages.
--- @return string mode The insert mode ("TOP" or "BOTTOM").
--- @example
--- local mode = myFrame:GetInsertMode()
GetInsertMode = function(self) end,
--- Scrolls down one line.
--- @example
--- myFrame:ScrollDown()
ScrollDown = function(self) end,
--- Scrolls up one line.
--- @example
--- myFrame:ScrollUp()
ScrollUp = function(self) end,
--- Scrolls to the bottom of the frame.
--- @example
--- myFrame:ScrollToBottom()
ScrollToBottom = function(self) end,
--- Scrolls to the top of the frame.
--- @example
--- myFrame:ScrollToTop()
ScrollToTop = function(self) end,
--- Sets the fade duration for messages.
--- @param duration number The fade duration in seconds.
--- @example
--- myFrame:SetFadeDuration(0.3)
SetFadeDuration = function(self, duration) end,
--- Sets whether fading is enabled.
--- @param enabled boolean True to enable fading.
--- @example
--- myFrame:SetFading(true)
SetFading = function(self, enabled) end,
--- Sets how long messages remain visible.
--- @param time number The time in seconds.
--- @example
--- myFrame:SetTimeVisible(5)
SetTimeVisible = function(self, time) end,
--- Sets the insert mode for new messages.
--- @param mode string The insert mode ("TOP" or "BOTTOM").
--- @example
--- myFrame:SetInsertMode("TOP")
SetInsertMode = function(self, mode) end,
--- Sets the maximum number of lines to display.
--- @param maxLines number The maximum number of lines.
--- @example
--- myFrame:SetMaxLines(50)
SetMaxLines = function(self, maxLines) end,
--- Sets the scroll offset.
--- @param offset number The scroll offset.
--- @example
--- myFrame:SetScrollOffset(5)
SetScrollOffset = function(self, offset) end,
--- Updates the color of a message by its ID.
--- @param id number The message ID.
--- @param r number The red color component.
--- @param g number The green color component.
--- @param b number The blue color component.
--- @example
--- myFrame:UpdateColorByID(1, 1, 0, 0)
UpdateColorByID = function(self, id, r, g, b) end,
--- Scrolls down one page.
--- @example
--- myFrame:PageDown()
PageDown = function(self) end,
--- Scrolls up one page.
--- @example
--- myFrame:PageUp()
PageUp = function(self) end,
}

155
ui/SimpleHTML.lua Normal file
View File

@@ -0,0 +1,155 @@
---@meta
---@class SimpleHTML : Frame
SimpleHTML = {
--- Gets the font properties for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return string fontFile, number height, string flags
--- @example
--- local fontFile, height, flags = myHTML:GetFont("p")
GetFont = function(self, element) end,
--- Gets the font object for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return FontObject fontObject The font object.
--- @example
--- local fontObject = myHTML:GetFontObject("h1")
GetFontObject = function(self, element) end,
--- Gets the hyperlink format string.
--- @return string format The hyperlink format.
--- @example
--- local format = myHTML:GetHyperlinkFormat()
GetHyperlinkFormat = function(self) end,
--- Gets whether hyperlinks are enabled.
--- @return boolean enabled True if hyperlinks are enabled.
--- @example
--- local enabled = myHTML:GetHyperlinksEnabled()
GetHyperlinksEnabled = function(self) end,
--- Gets the horizontal justification for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return string justifyH The horizontal justification.
--- @example
--- local justifyH = myHTML:GetJustifyH("p")
GetJustifyH = function(self, element) end,
--- Gets the vertical justification for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return string justifyV The vertical justification.
--- @example
--- local justifyV = myHTML:GetJustifyV("p")
GetJustifyV = function(self, element) end,
--- Gets the shadow color for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return number r, number g, number b, number a The shadow color.
--- @example
--- local r, g, b, a = myHTML:GetShadowColor("p")
GetShadowColor = function(self, element) end,
--- Gets the shadow offset for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return number x, number y The shadow offset.
--- @example
--- local x, y = myHTML:GetShadowOffset("p")
GetShadowOffset = function(self, element) end,
--- Gets the line spacing for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return number spacing The line spacing.
--- @example
--- local spacing = myHTML:GetSpacing("p")
GetSpacing = function(self, element) end,
--- Gets the text color for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return number r, number g, number b, number a The text color.
--- @example
--- local r, g, b, a = myHTML:GetTextColor("p")
GetTextColor = function(self, element) end,
--- Sets the font properties for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param fontFile string The font file path.
--- @param height number The font height.
--- @param flags? string Optional. The font flags.
--- @example
--- myHTML:SetFont("p", "Fonts\\FRIZQT__.TTF", 12, "OUTLINE")
SetFont = function(self, element, fontFile, height, flags) end,
--- Sets the font object for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param fontObject FontObject The font object.
--- @example
--- myHTML:SetFontObject("h1", GameFontNormalLarge)
SetFontObject = function(self, element, fontObject) end,
--- Sets the hyperlink format string.
--- @param format string The hyperlink format.
--- @example
--- myHTML:SetHyperlinkFormat("|cff0000ff|H%s|h%s|h|r")
SetHyperlinkFormat = function(self, format) end,
--- Sets whether hyperlinks are enabled.
--- @param enabled boolean True to enable hyperlinks.
--- @example
--- myHTML:SetHyperlinksEnabled(true)
SetHyperlinksEnabled = function(self, enabled) end,
--- Sets the horizontal justification for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param justifyH string The horizontal justification.
--- @example
--- myHTML:SetJustifyH("p", "CENTER")
SetJustifyH = function(self, element, justifyH) end,
--- Sets the vertical justification for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param justifyV string The vertical justification.
--- @example
--- myHTML:SetJustifyV("p", "MIDDLE")
SetJustifyV = function(self, element, justifyV) end,
--- Sets the shadow color for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param r number The red component.
--- @param g number The green component.
--- @param b number The blue component.
--- @param a? number Optional. The alpha component.
--- @example
--- myHTML:SetShadowColor("p", 0, 0, 0, 1)
SetShadowColor = function(self, element, r, g, b, a) end,
--- Sets the shadow offset for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param x number The horizontal offset.
--- @param y number The vertical offset.
--- @example
--- myHTML:SetShadowOffset("p", 1, -1)
SetShadowOffset = function(self, element, x, y) end,
--- Sets the line spacing for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param spacing number The line spacing.
--- @example
--- myHTML:SetSpacing("p", 2)
SetSpacing = function(self, element, spacing) end,
--- Sets the text color for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param r number The red component.
--- @param g number The green component.
--- @param b number The blue component.
--- @param a? number Optional. The alpha component.
--- @example
--- myHTML:SetTextColor("p", 1, 1, 1, 1)
SetTextColor = function(self, element, r, g, b, a) end,
--- Sets the HTML text to display.
--- @param text string The HTML text.
--- @example
--- myHTML:SetText("<p>Hello <b>World</b></p>")
SetText = function(self, text) end,
}

93
ui/Slider.lua Normal file
View File

@@ -0,0 +1,93 @@
---@meta
---@class Slider : Frame
Slider = {
--- Disables the slider.
--- @example
--- mySlider:Disable()
Disable = function(self) end,
--- Enables the slider.
--- @example
--- mySlider:Enable()
Enable = function(self) end,
--- Gets the minimum and maximum values.
--- @return number min, number max The minimum and maximum values.
--- @example
--- local min, max = mySlider:GetMinMaxValues()
GetMinMaxValues = function(self) end,
--- Gets the orientation of the slider.
--- @return string orientation The orientation ("HORIZONTAL" or "VERTICAL").
--- @example
--- local orientation = mySlider:GetOrientation()
GetOrientation = function(self) end,
--- Gets the page step size.
--- @return number stepSize The page step size.
--- @example
--- local stepSize = mySlider:GetStepsPerPage()
GetStepsPerPage = function(self) end,
--- Gets the thumb texture.
--- @return Texture texture The thumb texture.
--- @example
--- local texture = mySlider:GetThumbTexture()
GetThumbTexture = function(self) end,
--- Gets the current value.
--- @return number value The current value.
--- @example
--- local value = mySlider:GetValue()
GetValue = function(self) end,
--- Gets the value step size.
--- @return number stepSize The value step size.
--- @example
--- local stepSize = mySlider:GetValueStep()
GetValueStep = function(self) end,
--- Returns whether the slider is enabled.
--- @return boolean enabled True if the slider is enabled.
--- @example
--- local enabled = mySlider:IsEnabled()
IsEnabled = function(self) end,
--- Sets the minimum and maximum values.
--- @param min number The minimum value.
--- @param max number The maximum value.
--- @example
--- mySlider:SetMinMaxValues(0, 100)
SetMinMaxValues = function(self, min, max) end,
--- Sets the orientation of the slider.
--- @param orientation string The orientation ("HORIZONTAL" or "VERTICAL").
--- @example
--- mySlider:SetOrientation("HORIZONTAL")
SetOrientation = function(self, orientation) end,
--- Sets the page step size.
--- @param stepSize number The page step size.
--- @example
--- mySlider:SetStepsPerPage(10)
SetStepsPerPage = function(self, stepSize) end,
--- Sets the thumb texture.
--- @param texture Texture|string The texture or texture path.
--- @example
--- mySlider:SetThumbTexture("Interface\\Buttons\\UI-SliderBar-Button-Horizontal")
SetThumbTexture = function(self, texture) end,
--- Sets the current value.
--- @param value number The value to set.
--- @example
--- mySlider:SetValue(50)
SetValue = function(self, value) end,
--- Sets the value step size.
--- @param stepSize number The value step size.
--- @example
--- mySlider:SetValueStep(5)
SetValueStep = function(self, stepSize) end,
}

69
ui/StatusBar.lua Normal file
View File

@@ -0,0 +1,69 @@
---@meta
---@class StatusBar : Frame
StatusBar = {
--- Gets the minimum and maximum values of the bar.
--- @return number min, number max The minimum and maximum values.
--- @example
--- local min, max = myStatusBar:GetMinMaxValues()
GetMinMaxValues = function(self) end,
--- Gets the orientation of the status bar.
--- @return string orientation The orientation ("HORIZONTAL" or "VERTICAL").
--- @example
--- local orientation = myStatusBar:GetOrientation()
GetOrientation = function(self) end,
--- Gets the color of the status bar.
--- @return number r, number g, number b, number a The color components.
--- @example
--- local r, g, b, a = myStatusBar:GetStatusBarColor()
GetStatusBarColor = function(self) end,
--- Gets the texture object for the bar.
--- @return Texture texture The status bar texture.
--- @example
--- local texture = myStatusBar:GetStatusBarTexture()
GetStatusBarTexture = function(self) end,
--- Gets the current value of the bar.
--- @return number value The current value.
--- @example
--- local value = myStatusBar:GetValue()
GetValue = function(self) end,
--- Sets the minimum and maximum values of the bar.
--- @param min number The minimum value.
--- @param max number The maximum value.
--- @example
--- myStatusBar:SetMinMaxValues(0, 100)
SetMinMaxValues = function(self, min, max) end,
--- Sets the orientation of the status bar.
--- @param orientation string The orientation ("HORIZONTAL" or "VERTICAL").
--- @example
--- myStatusBar:SetOrientation("HORIZONTAL")
SetOrientation = function(self, orientation) end,
--- Sets the color of the status bar.
--- @param r number The red component.
--- @param g number The green component.
--- @param b number The blue component.
--- @param a number? Optional. The alpha component.
--- @example
--- myStatusBar:SetStatusBarColor(1, 0, 0, 1)
SetStatusBarColor = function(self, r, g, b, a) end,
--- Sets the texture of the bar.
--- @param texture string|Texture The texture path or texture object.
--- @param layer? string Optional. The layer to set the texture in.
--- @example
--- myStatusBar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar")
SetStatusBarTexture = function(self, texture, layer) end,
--- Sets the current value of the bar.
--- @param value number The value to set.
--- @example
--- myStatusBar:SetValue(50)
SetValue = function(self, value) end,
}

View File

@@ -1,6 +1,6 @@
---@meta
---@class Texture : TextureBase
---@class Texture : Region
Texture = {
--- Adds a mask texture to the texture.
--- @param mask Texture The mask texture to add.
@@ -27,110 +27,103 @@ Texture = {
--- myTexture:RemoveMaskTexture(myMaskTexture)
RemoveMaskTexture = function(self, mask) end,
--- Sets the texture to an atlas.
--- @param atlas string The atlas to set.
--- @param useAtlasSize boolean? Optional. Whether to use the atlas size.
--- @param filterMode string? Optional. The filter mode to use.
--- @param resetTexCoords boolean? Optional. Whether to reset texture coordinates.
--- Gets the blend mode of the texture.
--- @return string mode The blend mode.
--- @example
--- myTexture:SetAtlas("MyAtlas", true)
SetAtlas = function(self, atlas, useAtlasSize, filterMode, resetTexCoords) end,
--- local mode = myTexture:GetBlendMode()
GetBlendMode = function(self) end,
--- Gets the texture coordinates.
--- @return number ULx, number ULy, number LLx, number LLy, number URx, number URy, number LRx, number LRy
--- @example
--- local ULx, ULy, LLx, LLy, URx, URy, LRx, LRy = myTexture:GetTexCoord()
GetTexCoord = function(self) end,
--- Gets the texture path.
--- @return string texturePath The texture path.
--- @example
--- local texturePath = myTexture:GetTexture()
GetTexture = function(self) end,
--- Gets the vertex color.
--- @return number r, number g, number b, number a The color components.
--- @example
--- local r, g, b, a = myTexture:GetVertexColor()
GetVertexColor = function(self) end,
--- Gets whether the texture is desaturated.
--- @return boolean isDesaturated True if the texture is desaturated.
--- @example
--- local isDesaturated = myTexture:IsDesaturated()
IsDesaturated = function(self) end,
--- Sets the blend mode of the texture.
--- @param blendMode string The blend mode to set.
--- @param mode string The blend mode ("DISABLE", "BLEND", "ALPHAKEY", "ADD", "MOD").
--- @example
--- myTexture:SetBlendMode("ADD")
SetBlendMode = function(self, blendMode) end,
SetBlendMode = function(self, mode) end,
--- Sets the texture to a solid color.
--- @param colorR number The red component of the color.
--- @param colorG number The green component of the color.
--- @param colorB number The blue component of the color.
--- @param a number? Optional. The alpha component of the color.
--- @example
--- myTexture:SetColorTexture(1, 0, 0) -- Set to red
SetColorTexture = function(self, colorR, colorG, colorB, a) end,
--- Sets the texture to be desaturated.
--- @param desaturated boolean? Optional. True to desaturate the texture.
--- Sets whether the texture should be displayed without saturation.
--- @param desaturated boolean True to desaturate the texture.
--- @example
--- myTexture:SetDesaturated(true)
SetDesaturated = function(self, desaturated) end,
--- Sets the desaturation level of the texture.
--- @param desaturation number The desaturation level to set.
--- Sets a color gradient across the texture.
--- @param orientation string The gradient orientation ("HORIZONTAL" or "VERTICAL").
--- @param startR number The start red value.
--- @param startG number The start green value.
--- @param startB number The start blue value.
--- @param endR number The end red value.
--- @param endG number The end green value.
--- @param endB number The end blue value.
--- @example
--- myTexture:SetDesaturation(0.5) -- Set to 50% desaturation
SetDesaturation = function(self, desaturation) end,
--- myTexture:SetGradient("HORIZONTAL", 1, 0, 0, 0, 0, 1)
SetGradient = function(self, orientation, startR, startG, startB, endR, endG, endB) end,
--- Sets a gradient color shading for the texture.
--- @param orientation string The orientation of the gradient.
--- @param minColor table The minimum color.
--- @param maxColor table The maximum color.
--- Sets a color gradient with alpha across the texture.
--- @param orientation string The gradient orientation ("HORIZONTAL" or "VERTICAL").
--- @param startR number The start red value.
--- @param startG number The start green value.
--- @param startB number The start blue value.
--- @param startA number The start alpha value.
--- @param endR number The end red value.
--- @param endG number The end green value.
--- @param endB number The end blue value.
--- @param endA number The end alpha value.
--- @example
--- myTexture:SetGradient("HORIZONTAL", {1, 0, 0}, {0, 0, 1}) -- Red to Blue
SetGradient = function(self, orientation, minColor, maxColor) end,
--- myTexture:SetGradientAlpha("VERTICAL", 1, 0, 0, 1, 0, 0, 1, 0)
SetGradientAlpha = function(self, orientation, startR, startG, startB, startA, endR, endG, endB, endA) end,
--- Sets whether the texture should tile horizontally.
--- @param tiling boolean? Optional. True to enable horizontal tiling.
--- Sets the texture's rotation.
--- @param angle number The rotation angle in radians.
--- @param cx number? Optional. The x coordinate of the rotation center.
--- @param cy number? Optional. The y coordinate of the rotation center.
--- @example
--- myTexture:SetHorizTile(true)
SetHorizTile = function(self, tiling) end,
--- myTexture:SetRotation(math.pi / 2)
SetRotation = function(self, angle, cx, cy) end,
--- Applies a mask to the texture.
--- @param file string The file path of the mask.
--- @example
--- myTexture:SetMask("Interface\\Textures\\Mask")
SetMask = function(self, file) end,
--- Applies a rotation to the texture.
--- @param radians number The rotation in radians.
--- @param normalizedRotationPoint table? Optional. The normalized rotation point.
--- @example
--- myTexture:SetRotation(math.rad(45)) -- Rotate 45 degrees
SetRotation = function(self, radians, normalizedRotationPoint) end,
--- Sets the texture to snap to the pixel grid.
--- @param snap boolean? Optional. True to enable snapping.
--- @example
--- myTexture:SetSnapToPixelGrid(true)
SetSnapToPixelGrid = function(self, snap) end,
--- Sets the coordinates for cropping or transforming the texture.
--- Sets the texture coordinates.
--- @param left number The left coordinate.
--- @param right number The right coordinate.
--- @param bottom number The bottom coordinate.
--- @param top number The top coordinate.
--- @param bottom number The bottom coordinate.
--- @example
--- myTexture:SetTexCoord(0, 1, 0, 1) -- Full texture
SetTexCoord = function(self, left, right, bottom, top) end,
--- myTexture:SetTexCoord(0, 1, 0, 1)
SetTexCoord = function(self, left, right, top, bottom) end,
--- Sets the texel snapping bias for the texture.
--- @param bias number The texel snapping bias to set.
--- Sets the texture to be displayed.
--- @param texture string|number The texture path or file ID.
--- @example
--- myTexture:SetTexelSnappingBias(0.5)
SetTexelSnappingBias = function(self, bias) end,
--- myTexture:SetTexture("Interface\\Icons\\Spell_Nature_Regeneration")
SetTexture = function(self, texture) end,
--- Sets the texture to an image.
--- @param textureAsset string The texture asset to set.
--- @param wrapModeHorizontal string? Optional. The horizontal wrap mode.
--- @param wrapModeVertical string? Optional. The vertical wrap mode.
--- @param filterMode string? Optional. The filter mode.
--- Sets the texture to a solid color.
--- @param r number The red component.
--- @param g number The green component.
--- @param b number The blue component.
--- @param a number? Optional. The alpha component.
--- @example
--- myTexture:SetTexture("Interface\\Textures\\MyTexture")
SetTexture = function(self, textureAsset, wrapModeHorizontal, wrapModeVertical, filterMode) end,
--- Sets whether the texture should tile vertically.
--- @param tiling boolean? Optional. True to enable vertical tiling.
--- @example
--- myTexture:SetVertTile(true)
SetVertTile = function(self, tiling) end,
--- Sets a vertex offset for the texture.
--- @param vertexIndex number The index of the vertex.
--- @param offsetX number The x offset to set.
--- @param offsetY number The y offset to set.
--- @example
--- myTexture:SetVertexOffset(1, 5, 5)
SetVertexOffset = function(self, vertexIndex, offsetX, offsetY) end,
--- myTexture:SetColorTexture(1, 0, 0, 1)
SetColorTexture = function(self, r, g, b, a) end,
}

22
ui/UIObject.lua Normal file
View File

@@ -0,0 +1,22 @@
---@meta
---@class UIObject : Object
UIObject = {
--- Returns whether the object is loaded.
--- @return boolean isLoaded True if the object is loaded.
--- @example
--- local isLoaded = myUIObject:IsLoaded()
IsLoaded = function(self) end,
--- Returns whether the object is visible.
--- @return boolean isVisible True if the object is visible.
--- @example
--- local isVisible = myUIObject:IsVisible()
IsVisible = function(self) end,
--- Returns whether the object is shown.
--- @return boolean isShown True if the object is shown.
--- @example
--- local isShown = myUIObject:IsShown()
IsShown = function(self) end,
}