Appearance
InteractiveLabel
A Label that responds to mouse interaction, adding a highlight texture and click/hover callbacks.
Create with AceGUI:Create("InteractiveLabel"). It inherits the Common Widget API. It is built on top of the Label widget and supports all of Label's methods (SetText, SetImage, SetColor, SetFontObject, etc.) in addition to the methods below.
Widget type: InteractiveLabel
Methods
SetHighlight
method#
lua
widget:SetHighlight(...)Sets the texture shown when the label is hovered.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
... | any | Arguments forwarded to the highlight texture's SetTexture (e.g. a texture path or file ID); pass nothing to clear the highlight. |
SetHighlightTexCoord
method#
lua
widget:SetHighlightTexCoord(...)Sets the texture coordinates of the highlight texture.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
... | number | Either 4 (left, right, top, bottom) or 8 coordinate values. Any other count falls back to the full texture (0, 1, 0, 1). |
SetDisabled
method#
lua
widget:SetDisabled(disabled)Enables or disables interaction. When disabled, the frame stops accepting mouse input and the text is greyed out.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
disabled | boolean | true to disable, false to enable. |
Defaults
On acquire the interactive label runs the inherited Label acquire (resetting text, image, color, font, and justification), then clears the highlight texture and tex-coords and sets the widget enabled.
Callbacks
In addition to any callbacks inherited from Label, the following are fired:
OnClick
callback#
lua
OnClick(button)Fired when the label is clicked (on mouse down); AceGUI clears focus afterward. Subscribe with widget:SetCallback.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
button | string | The mouse button that was pressed (e.g. "LeftButton"). |
OnEnter
callback#
lua
OnEnter()Fired when the mouse enters the label. Subscribe with widget:SetCallback.
OnLeave
callback#
lua
OnLeave()Fired when the mouse leaves the label. Subscribe with widget:SetCallback.
Example
lua
local label = AceGUI:Create("InteractiveLabel")
label:SetText("Click me")
label:SetHighlight("Interface\\QuestFrame\\UI-QuestTitleHighlight")
label:SetCallback("OnClick", function(widget, event, button)
print("Clicked with", button)
end)