Thread Tools Display Modes
Prev Previous Post   Next Post Next
04/14/14, 11:23 AM   #1
Edda
 
Edda's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 60
GetAnchor() ?

Hello,

I am facing a little problem here : I am new to Lua and don't konw the difference between the '.' operator and ':' operators.

I know the dot operator is used to get/use parameters and methods of said object but why and when do we have to use the ':' operator ?

My second question is : I am trying to save an UI element position is user's saved variables but I haven't had luck with 'GetAnchor()' yet. I did try

Code:
MyElement:GetAnchor()
returns boolean (true) only - I guess the operator tests if the method exists ??? - but then why can we use MyElement:SetAnchor(args) ?

Well then I tried

Code:
MyElement.GetAnchor()
But I get API error 'userdata expected, got no value'.

Doc says you have to pass the AnchorIndex to the function so I finally tried

Code:
MXPVUI.GetAnchor(MXPVUI.anchorIndex)
No luck

Where do I put the AnchorIndex tag in the XML file ? Am I doing the thing right ???

Explanation very welcome if you experienced doing the same thing
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » GetAnchor() ?


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