Help with XML to LUA
1 Attachment(s)
I'm trying to reduplicate this nice little title bar I've seen (Attached), but the thing is in XML and I can't figure out how to convert it.
Code:
<Texture name="$parentTitleBG" file="Interface\PaperDollInfoFrame\UI-GearManager-Title-Background"> |
Code:
<Texture name="$parentTitleBG" file="Interface\PaperDollInfoFrame\UI-GearManager-Title-Background"> lua Code:
|
1 Attachment(s)
Thanks for the conversion. Alas, now its being funky.
Code:
function SK.LoadMain() |
Code:
local HeaderBar = SK.Frame.Options:CreateTexture(SK.Frame.Options:GetName().."HeaderBar") |
Another...
Thanks for the help with that.
How can I setup a custom border texture? This one is kinda nuts to me. Also really new... This is what I have to work with... Code:
<Layer level="BORDER"> Code:
-- Sets a Texture Frame for the window |
Looks about right, but you need to create the texture before you apply it.
Example lua Code:
|
Opps. Lol Thanks for that insight.
Code:
<Anchors> |
If you want it to look the same, yeah.
|
1 Attachment(s)
Holy crap I am so new at this. I put all the points down from the XML. Wow it looks bad. lol. Feel free to laugh with me. Its funny looking. :p
Code:
-- Sets a Texture Frame for the window |
If you break the XML-parts that sets points, you'll see that there's three important things. Point, relativeTo and relativePoint. What this means is that you anchor <point> of your frame to frame <relativeTo>s <relativePoint>.
Example lua Code:
Just substitute the correct values from your original XML. |
Aw crap. I forgot about the relative to points. Junk. lol
thanks. Hopefully I come back with better news. XD |
Quote:
if you say your frame has a size of x=32 and y=32 then say :SetPoint("CENTER") then what it does is set the top y/2 (16 in this case) points from the center of the designated point, sets the left 16 points to the left and so on. by saying :SetPoint("TOPLEFT") with the size x=32 and y=32 we are setting the left and top points of the frame to 0, and the bottom and right part to 32 px away. so lets say Code:
local frame = CreateFrame("Frame", "myFrame", UIParent) if you did Code:
local frame = CreateFrame("Frame", "myFrame", UIParent) so you can declare any frame with only anchors if you want, just as long as all 4 points are declared. which can be called in 2 commands with TOPLEFT and BOTTOMRIGHT or TOPRIGHT and BOTTOMLEFT and a frame can be declared with a width and height as long as one point is given. and then wow will figure out the rest :) hopefully i didnt confuse :< if i did, sorry |
1 Attachment(s)
Well, it looks better... lol. At first I used SetPoint("TOPRIGHT", BorderTR, 0, 0)
Then I named the textures in CreateTexture(), and used their names, since its whats being done in the XML. Code:
-- Sets a Texture Frame for the window |
try going back through and removing the quotes from your set points on frame references
Code:
BorderT:SetPoint("TOPLEFT", "OptBorderTL", "TOPRIGHT", 0, 0) Code:
BorderT:SetPoint("TOPLEFT", OptBorderTL, "TOPRIGHT", 0, 0) |
Bah. I had just placed some Numbers in the SetTexCoord() wrongly. My bad. :o Anyways.
So now I'm translating this segment... Code:
<Frame name="$parentTitleButton"> Code:
-- Drag Bar Frame |
Is this line
lua Code:
supposed to be equivalent to this line xml Code:
? If so, they are not. :P The one you have in the lua says that when an event fire it should perform :RegisterForDrag. But you never register any event for the frame. Frames created via lua doesn't have a OnLoad-script as far as I know, so you can just do this straight away. lua Code:
You might have to run :EnableMouse(true) as well. |
Thanks for the help. I had to do :SetMovable() on my frame too, dur. :)
|
Code:
SK.Frame.Options_Drag:SetScript("OnEvent", function(obj, event, ...) self:RegisterForDrag("LeftButton") end) |
All times are GMT -6. The time now is 05:57 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI