WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   SetStartPoint() offsets not working? (https://www.wowinterface.com/forums/showthread.php?t=58326)

LudiusMaximus 10-19-20 11:48 AM

SetStartPoint() offsets not working?
 
Are these definitions of SetStartPoint() and SetEndPoint() not accurate?
Or what am I doing wrong?

Code:

local f = CreateFrame("Frame", nil, UIParent)
f:SetWidth(50)
f:SetHeight(50)
f:SetPoint("CENTER")
f:Show()

-- Offsets not working.
local line1 = f:CreateLine()
line1:SetThickness(3)
line1:SetColorTexture(1, 0, 0, 1)
line1:SetStartPoint("BOTTOMLEFT", f, "BOTTOMLEFT", 10, 10)
line1:SetEndPoint("TOPRIGHT", f, "TOPRIGHT", -10, -10)

-- Offsets working.
local line2 = f:CreateLine()
line2:SetThickness(3)
line2:SetColorTexture(0, 0, 1, 1)
line2:SetStartPoint("TOPLEFT", 10, -10)
line2:SetEndPoint("BOTTOMRIGHT", -10, 10)


Fizzlemizz 10-19-20 01:29 PM

The first entry refers to the point on the target object to want to anchor the start of the line too (there is no second "attachto" point al-la SetPoint()).

Code:

line1:SetStartPoint("BOTTOMLEFT", f, 10, 10)
line1:SetEndPoint("TOPRIGHT", -10, -10)

Code:

line1:SetStartPoint("BOTTOMLEFT", f, "BOTTOMLEFT", 10, 10)
Attach the start of the line to "BOTTOMLEFT" of f at offset x of "BOTTOMLEFT", and offset y of 10 with the last 10 being ignored.

LudiusMaximus 10-19-20 01:32 PM

Ah, all right. Actually makes sense. Because a line does not have any other points than start and end... :o
Thank you very much!

Ketho 10-19-20 02:00 PM

Oh hey more stuff that still needs to be documented but nobody else wants to do 😟

LudiusMaximus 10-19-20 02:21 PM

Quote:

Originally Posted by Ketho (Post 337330)
Oh hey more stuff that still needs to be documented but nobody else wants to do 😟

No worries, the Wowpedia article is correct. I just did not read it correctly and was still in the mindset of using SetPoint() all the time, where you give a point and relative point. But for LineStart and LineEnd there is only the relative point, obviously.


All times are GMT -6. The time now is 07:25 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI