Thread Tools Display Modes
10-19-20, 11:48 AM   #1
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
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)
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote
10-19-20, 01:29 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 10-19-20 at 01:38 PM.
  Reply With Quote
10-19-20, 01:32 PM   #3
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
Ah, all right. Actually makes sense. Because a line does not have any other points than start and end...
Thank you very much!
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote
10-19-20, 02:00 PM   #4
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Oh hey more stuff that still needs to be documented but nobody else wants to do 😟
  Reply With Quote
10-19-20, 02:21 PM   #5
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
Originally Posted by Ketho View Post
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.
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » SetStartPoint() offsets not working?

Thread Tools
Display Modes

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