Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API Frame CreateTitleRegion

Last wiki revision 2017-09-04

Creates a title region on a Frame that allows dragging of the frame with no other code.

titleRegion = myFrame:CreateTitleRegion

Example usage

myFrame.titleRegion = myFrame:CreateTitleRegion myFrame.titleRegion:SetSize(600, 24) -- 600 wide x 24 tall myFrame.titleRegion:SetPoint("TOPLEFT") -- anchor the titleRegion to top left of myFrame -- this is the drag bar texture myFrame.titleTexture = myFrame:CreateTexture("myFrame_titleTexture", "ARTWORK") myFrame.titleTexture:SetSize(600, 24) -- texture is the same size as the title drag bar myFrame.titleTexture:SetPoint("TOPLEFT") myFrame.titleTexture:SetColorTexture( .3, .3, .3, .5) -- give it a light grey color

note: If the frame is hidden, dragging will not function when it is shown, so implement a function to re-enable dragging when shown

-- -- toggle the frame shown and hidden -- function MyAddOn:Frame_Toggle myFrame.titleRegion:ClearAllPoints if ( myFrame:IsVisible ) then --hide the frame if it's visible myFrame:Hide else --show the frame if it's hidden myFrame:Show myFrame.titleRegion:SetPoint("TOPLEFT") end end

Source

https://warcraft.wiki.gg/wiki/API_Frame_CreateTitleRegion · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.