WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   How to draw an horizontal line? (https://www.wowinterface.com/forums/showthread.php?t=45500)

Spyro 12-23-12 01:58 PM

How to draw an horizontal line?
 
Hi, I want to make a header like the ones on this image, but I have no idea on how to draw that horizontal line:

It's an small addon so I'm using no libs, just XML and default API.
Anybody knows how to do it? :)

Haleth 12-23-12 02:01 PM

Use CreateTexture(). Example:

Lua Code:
  1. local line = f:CreateTexture()
  2. line:SetTexture(.6 ,.6, .6, .2)
  3. line:SetSize(100, 1)
  4. line:SetPoint("CENTER", f)

Where f is the name of your frame.

Spyro 12-23-12 02:10 PM

Thx for the instant response :) :banana:

LudiusMaximus 05-14-20 07:46 AM

This does not seem to work any more.
The following is how it can be done.

Code:

local line = f:CreateTexture()
line:SetTexture("Interface/BUTTONS/WHITE8X8")
line:SetColorTexture(.6 ,.6, .6, .2)
line:SetSize(100, 1)
line:SetPoint("CENTER")


Fizzlemizz 05-14-20 11:00 AM

There is now a line widget CreateLine.

LudiusMaximus 05-14-20 11:49 AM

Quote:

Originally Posted by Fizzlemizz (Post 335922)
There is now a line widget CreateLine.

Wow, even better! :)

See also: https://wow.gamepedia.com/Widget_API#Line


All times are GMT -6. The time now is 12:19 PM.

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