Saturday, April 21, 2012

Started with XML and kinda confused

Hi Guyz. i was trying to make a simple square of pixels in the screen, looking for different ways to dock it. But it seems my Xml files don't work at all. It visualize the square owever it always appear on the left side of the screen even if i told him to anchor on top enter or top right. What's is wrong with this ? Can you help or explain ?

Thank you much in advance.

Arngrim




Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">

<Script file="MyFrame.lua"/>

<Frame name="MyFrame" toplevel="true" frameStrata="BACKGROUND" movable="true" enableMouse="true" hidden="false" parent="UIParent">
<Size>
<AbsDimension x="350" y="100"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture file="Interface\TabardFrame\TabardFrameBackground">
<Size>
<AbsDimension x="350" y="100"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
MyFrame_OnLoad();
</OnLoad>
<OnEvent>
MyFrame_OnEvent();
</OnEvent>
</Scripts>
</Frame>
</Ui>
|||Moved as per the FAQ:
Quote:




Threads about finding, installing, using and troubleshooting mods go in the UI customisation Forum.

Threads about designing, coding and testing mods go in the UI Development Forum.

Threads about other topics should go in the relevant other forum.|||Quote:








Moved as per the FAQ:




Thank you for moving. Sorry to have posted in the wrong place. So anyone up on this ?|||You defined the frame to be moveable in your xml with


Code:
movable="true" enableMouse="true"

so why not complete your script and just move it to where you want it?


Code:
<Scripts>
<OnLoad>
this:RegisterForDrag("LeftButton")
this:SetAlpha(0.8);
</OnLoad>
<OnDragStart>
this:StartMoving();
this.isMoving = true;
</OnDragStart>
<OnDragStop>
this:StopMovingOrSizing();
this.isMoving = false;
</OnDragStop>
</Scripts>
|||Quote:








You defined the frame to be moveable in your xml with


Code:
movable="true" enableMouse="true"

so why not complete your script and just move it to where you want it?


Code:
<Scripts>
<OnLoad>
this:RegisterForDrag("LeftButton")
this:SetAlpha(0.8);
</OnLoad>
<OnDragStart>
this:StartMoving();
this.isMoving = true;
</OnDragStart>
<OnDragStop>
this:StopMovingOrSizing();
this.isMoving = false;
</OnDragStop>
</Scripts>






Basically because i want to let it pop exactly where i need or where i left it the last time the addon reloaded or frame popped. I could try to use the SetPOint() function, but I started brand new and i don't know how to set dynamic variables, and how anchor point are passed. I was wondering to do it later. It's possible that anyone don't know why i can't anchor a new frame exactly where i want ? I need just this information.|||Well here is one thing wrong


Code:
<Anchors>
<Anchor point="TOPLEFT">
</Anchors>

should be


Code:
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>

You left off the / after TOPLEFT

No comments:

Post a Comment