Skip to content

Windows Static API

ArcaneWizardLibrary.Windows creates consistently styled addon windows from the library's scalable textures.

Both methods return standard WoW frames. The frames are centered and hidden after creation, allowing the consuming addon to add controls before calling Show().

Close buttons use Library's own artwork and therefore look identical across supported game versions. Large windows use the 18 x 18 window variant, while popups use the 14 x 14 popup variant.

CreateWindow(title, width, height, showCloseButton, backgroundAlpha, movable, backgroundStyle, showPortrait, titleTransitionStyle)

Creates a large window with a thin Retail-style frame and an integrated title bar.

lua
local window = ArcaneWizardLibrary.Windows:CreateWindow("My Addon", 700, 480, true, 0.9, true, "solid", true, "line")

window.portrait:SetTexture("Interface\\AddOns\\MyAddon\\assets\\icon.blp")
window.portraitBackground:SetColorTexture(0.035, 0.035, 0.035, 1)

local text = window.content:CreateFontString(nil, "OVERLAY", "GameFontNormal")
text:SetPoint("TOPLEFT")
text:SetText("Window content")

window:Show()

The title remains centered when the window is resized. Change its text after creation with window.titleText:SetText(text).

Parameters

ParameterTypeDescription
titlestringText displayed in the integrated title bar.
widthnumberInitial width. Must be at least 256.
heightnumberInitial height. Must be at least 192.
showCloseButtonbooleanCreates an X button in the upper-right corner when true.
backgroundAlphanumberInitial background opacity from 0 to 1.
movablebooleanAllows the window and its title bar to be dragged when true.
backgroundStylestringBackground style provided by the library. See the available styles below.
showPortraitbooleanCreates a thin gold portrait frame in the upper-left corner when true.
titleTransitionStylestringTitle transition style: shadow, groove, or line.

Title transition styles

StyleDescription
shadowOne-pixel separator with a soft twelve-pixel shadow.
grooveInset light and dark separator with a twelve-pixel shadow.
lineInset light and dark separator without a shadow.

Returned fields

FieldTypeDescription
backgroundTextureBackground layer whose color, texture, and opacity can be changed.
contentFrameContent area inside the frame and below the title bar.
titleBarFrameIntegrated title bar and drag handle.
titleBackgroundTextureSeparate title bar background.
titleTransitionLinesTexture[]Lines separating the title bar and window background.
titleShadowLayersTexture[]Fading shadow below the title transition.
titleTextFontStringTitle font string.
portraitFrameFrame | nilOptional portrait frame.
portraitBackgroundTexture | nilOpaque background behind transparent portrait images.
portraitTexture | nilOptional masked portrait image. Set its image with SetTexture().
closeButtonButton | nilOptional close button.

CreatePopup(width, height, showCloseButton, showBorder, backgroundAlpha, movable, backgroundStyle)

Creates a compact popup with a thinner frame from the same design family.

lua
local popup = ArcaneWizardLibrary.Windows:CreatePopup(360, 160, true, true, 0.9, true, "solid")

popup:Show()

Parameters

ParameterTypeDescription
widthnumberInitial width. Must be at least 128.
heightnumberInitial height. Must be at least 96.
showCloseButtonbooleanCreates an X button in the upper-right corner when true.
showBorderbooleanCreates the popup border when true. Without a border, the background fills the complete frame.
backgroundAlphanumberInitial background opacity from 0 to 1.
movablebooleanAllows the popup to be dragged when true.
backgroundStylestringBackground style provided by the library. See the available styles below.
The returned popup exposes background, content, and the optional closeButton fields.

Customizing the background

The border and background use separate layers. Setting the background alpha to 0 therefore keeps the border visible.

Available background styles:

StyleAppearance
"solid"Single dark background color.
"panel-dark"Warm dark panel with soft medium-scale variations.
"slate-dark" / "slate-light"Layered slate texture.
"leather-dark" / "leather-light"Fine aged leather texture.
lua
window.background:SetColorTexture(0.02, 0.025, 0.03, 1)
window.background:SetAlpha(0.85)

Changing the background does not affect controls added to window.content.

Texture backgrounds use 256 x 256 source images and repeat at a fixed size of 256 UI pixels instead of being stretched. Their texture coordinates are updated automatically whenever the window or popup is resized.

Showing, closing, and resizing

The returned objects are standard WoW frames. Use their existing frame methods:

lua
window:Show()
window:Hide()
window:SetSize(800, 600)

Hide() closes the window without destroying it, so it can be shown again later. The optional X button also calls Hide().

Dragging changes the frame position for the current session. Persisting that position remains the responsibility of the consuming addon.

Built with VitePress (MIT License).