Thread Tools Display Modes
05/17/14, 01:57 PM   #1
Tar000un
 
Tar000un's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 47
ZO xml newb

Hi,

i ve started to code an addon today, my first addon and dev in lua x)
And i ve few problems with the xml part.

Code:
<GuiXml>
    <Controls>
        <TopLevelControl name="MyAddOnUI" mouseEnabled="true" movable="true" clampedToScreen="true" >
		  <Anchor point="TOPLEFT" offsetX="10" offsetY="50" />

          <OnMoveStop>
			MyAddOn.OnMoveStop( self )
          </OnMoveStop>

          <OnUpdate>
            MyAddOn.Update()
          </OnUpdate>
          
          <Controls>
            <Backdrop name="$(parent)BG" inherits="ZO_DefaultBackdrop" centerColor="000000" alpha="0.8" >
              <AnchorFill />
              <Edge edgeSize="2" />
            </Backdrop>
            <Label name="$(parent)Window" font="ZoFontAnnounceSmall" 
				verticalAlignment="CENTER" text="MyAddOn" 
				horizontalAlignment="CENTER" alpha="0.85" >
              <AnchorFill />
            </Label>			
          </Controls>		  
          
        </TopLevelControl>
    </Controls>
</GuiXml>
First, i ve a problem with padding of the backdrop, where i tryed to use a <ResizeToFitPadding />, after the <AnchorFill />, but still with this horrible thing : http://i60.tinypic.com/33113bb.jpg

In a second step, i want to use a dds and modifiy the texture of the windows, but i didnt succed.

Moreover, can we draw a circle ? or would i draw a square then fill it with a circle dds ?

Last edited by Tar000un : 05/17/14 at 02:00 PM.
  Reply With Quote
05/18/14, 03:52 AM   #2
Tar000un
 
Tar000un's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 47
I succeded to avoid the horrible thing (which is simply invisible now...) and i tried to create a texture with gimp, which always failed. I suppose the gimp plugin out-of-date, and i had to install Paint.net.

As my own answer, we need to draw an empty element and fill it with the texture.

Last edited by Tar000un : 05/18/14 at 04:05 AM.
  Reply With Quote
05/18/14, 07:29 AM   #3
Tar000un
 
Tar000un's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 47
Because the xml doc is a ****ing pain for newbs (specially for non-english person, like me...) :

I used a LUA code to create xml node but that dont really answer my needs and arranging the vars in a table seems a source of UI's errors.
example here about the LUA code : https://code.google.com/p/zork-esoui...extureTest.lua

But after few tests, to find how to place the nodes, i got a solution ! A sample of my new xml :
Code:
<Controls>
     <Backdrop name="$(parent)_BG" inherits="ZO_CenterlessBackdrop" 
              edgeColor="000000" centerColor="000000" alpha="0">
          <AnchorFill />
     </Backdrop>
     <Texture name="$(parent)_Texture" />
     <Label name="$(parent)_Label" font="ZoFontGameLarge" 
         verticalAlignment="BOTTOM" horizontalAlignment="CENTER" 
         text="MyAddon" alpha="0.5" >              
     </Label>        		
</Controls>
Which is filled by the code :
Code:
    AddOnUI_Texture:SetDimensions( 128, 128);
    AddOnUI_Texture:SetAnchor(TOPLEFT, AddOnUI_BG, TOPLEFT, 0, 0);
    AddOnUI_Texture:SetTexture(MyTexture);

    AddOnUI_Label:SetDimensions( 128, 20);
    AddOnUI_Label:SetAnchor(BOTTOM, AddOnUI_BG, BOTTOM, 0, 0);
    AddOnUI_Label:SetText("The Label");

Last edited by Tar000un : 05/18/14 at 07:37 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » ZO xml newb


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off