Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:XML/Anchor
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Full Key Based Example === This is a more complex, albeit awkward, example using 'keys' rather than 'names' for referencing frames. The template in this case uses 'keys' instead of names to make for a cleaner global name space, as this template is used a lot. The imputus for this template was to use explicit button layer frames, as the 'Button' frame type only knows how to stretch a single simple texture. Using three cuts down on horizontal scaling distortion at the ends for different button sizes. Notice that each original texture is sliced using texture coords so that the ends dont stretch, but is the same texture. Notice that the scripts have to manage the button's texture expressly, as the normal button texture management isn't used. Also important is that the parent keys are available to the script just like any other member of a frame's Lua side runtime object. ''Note: Portions edited for brevity. See WoW UI Toolkit for complete original template. As always, if copy/paste give template another name.'' <Button name="UIPanelButtonXxxTemplate" virtual="true"> <Size x="40" y="22"/> <Layers> <Layer level="BACKGROUND"> <Texture parentKey="Left" file="Interface\Buttons\UI-Panel-Button-Up"> <Size x="12"/> <Anchors> <Anchor point="TOPLEFT"/> <Anchor point="BOTTOMLEFT"/> </Anchors> <TexCoords left="0" right="0.09375" top="0" bottom="0.6875"/> </Texture> <Texture parentKey="Right" file="Interface\Buttons\UI-Panel-Button-Up"> <Size x="12"/> <Anchors> <Anchor point="TOPRIGHT"/> <Anchor point="BOTTOMRIGHT"/> </Anchors> <TexCoords left="0.53125" right="0.625" top="0" bottom="0.6875"/> </Texture> <Texture parentKey="Middle" file="Interface\Buttons\UI-Panel-Button-Up"> <Anchors> <Anchor point="TOPLEFT" relativeKey="$parent.Left" relativePoint="TOPRIGHT"/> <Anchor point="BOTTOMRIGHT" relativeKey="$parent.Right" relativePoint="BOTTOMLEFT"/> </Anchors> <TexCoords left="0.09375" right="0.53125" top="0" bottom="0.6875"/> </Texture> </Layer> </Layers> <Scripts> <OnMouseDown> if not self:IsEnabled() then return end self.Left:SetTexture("Interface\\Buttons\\UI-Panel-Button-Down"); self.Middle:SetTexture("Interface\\Buttons\\UI-Panel-Button-Down"); self.Right:SetTexture("Interface\\Buttons\\UI-Panel-Button-Down"); </OnMouseDown> <OnMouseUp> if not self:IsEnabled() then return end self.Left:SetTexture("Interface\\Buttons\\UI-Panel-Button-Up"); self.Middle:SetTexture("Interface\\Buttons\\UI-Panel-Button-Up"); self.Right:SetTexture("Interface\\Buttons\\UI-Panel-Button-Up"); </OnMouseUp> <OnDisable> self.Left:SetTexture("Interface\\Buttons\\UI-Panel-Button-Disabled"); self.Middle:SetTexture("Interface\\Buttons\\UI-Panel-Button-Disabled"); self.Right:SetTexture("Interface\\Buttons\\UI-Panel-Button-Disabled"); </OnDisable> </Scripts> <ButtonText name="$parentText"/> <NormalFont style="GameFontNormal"/> <HighlightFont style="GameFontHighlight"/> <DisabledFont style="GameFontDisable"/> <HighlightTexture inherits="UIPanelButtonHighlightTexture"/> </Button> See also [[XML/Button|XML Button]]. [[Category:XML elements]]
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)