ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   How can I add an horizontal line? (https://www.esoui.com/forums/showthread.php?t=1168)

Artajörn 04/25/14 12:05 PM

How can I add an horizontal line?
 
Hi,

I would like to add an horizontal line under the header in the window of my addon (like those which appears in the windows of the main menu). Does anyone know how can I do it?

Regards and thanks in advance. :)

Fathis Ules 04/25/14 12:28 PM

I believe you will need something like (sorry only working with LUA not xml)

Lua Code:
  1. local line  = CreateControl(nil, <youraddonwindowobject>,  CT_LINE)
  2. line:SetAnchor(TOPLEFT, <youraddonwindowobject>, TOPLEFT, 0, 10)
  3. line:SetAnchor(TOPRIGHT, <youraddonwindowobject>, TOPRIGHT, 0, 10)

to see methods of line http://wiki.esoui.com/Controls#LineControl

mra4nii 04/25/14 12:38 PM

If is about menu window LibAddonMenu have this, you should use it and make your live easier :)
If not for menu, try this for header control of your window:
Quote:

control.controlType = OPTIONS_SECTION_TITLE

Artajörn 04/27/14 01:05 PM

I have tried with:

Code:

<Line name="HeaderSeparator">
        <Anchor offsetY="77" point="CENTER" relativeTo="$(parent)"/>
        <Dimensions x="780" y="10"/>
</Line>

But it's useless. :(

Seerah 04/27/14 01:52 PM

The default UI just uses a regular texture control.

Stormknight 04/27/14 02:56 PM

There's a number of line textures. I'll post them tomorrow after work.

Seerah 04/27/14 04:15 PM

Or, if you just want a solid color, don't set a texture path and just change the color to what you want it to be. :)

Stormknight 04/28/14 04:33 PM

Here's the line textures I found:

/esoui/art/miscellaneous/wide_divider_left.dds
/esoui/art/miscellaneous/wide_divider_right.dds
/esoui/art/progression/ability_line.dds
/esoui/art/quest/questjournal_divider.dds

So to create the line I do something like (assuming a top level control of MyAddonTLC:
Lua Code:
  1. TopDivider = WINDOW_MANAGER:CreateControl("MyAddonTopDivider", MyAddonTLC, CT_TEXTURE)
  2. TopDivider:SetDimensions(760, 5)
  3. TopDivider:SetAnchor(TOPLEFT, AIResearchGrid, MyAddonTLC, 0, 32)
  4. TopDivider:SetTexture("/esoui/art/quest/questjournal_divider.dds")

Artajörn 05/02/14 05:10 AM

Hi,

First of all, thank you very much for your answers.

I'm trying with:

Code:

<Line name="IFTESO_ResearchHeaderSeparator" textureFile="esoui/art/quest/questjournal_divider.dds">
        <Anchor offsetY="77" point="TOP" relativeTo="$(parent)"/>
        <AnchorFill/>
        <Dimensions x="780" y="5"/>
</Line>

Now the line is shown but it is shown diagonally rather than horizontally. Does anyone know how to fix it?

Thanks in advance! ;)

Stormknight 05/02/14 05:15 AM

Could you post your code that creates the line, so we can see it? :)

Artajörn 05/02/14 06:27 AM

Sorry I forgot to put the code, hehehehe. :p

Stormknight 05/02/14 07:06 AM

I've not tried using the line control before, so can't offer advice on that.

When I needed a line, I just used the texture control.

Artajörn 05/02/14 08:09 AM

Quote:

Originally Posted by Stormknight (Post 6698)
I've not tried using the line control before, so can't offer advice on that.

When I needed a line, I just used the texture control.

And how do you do that? :confused:

Halja 05/02/14 08:29 AM

Put a second anchor for the bottom right. That will help set the bounds for the textures height and width of you divider line.
--Halja

Seerah 05/02/14 01:07 PM

You added two anchors in your XML. Remove the AnchorFill line.

Artajörn 05/04/14 07:28 AM

When I remove the AnchorFill line, nothing is displayed.

However I'm going to remake my addon to create a better project and I will create the GUI in Lua. I'll post here if I find problems to implement the horizontal line in Lua.

Regards and thank you very much for your answers! :)


All times are GMT -6. The time now is 04:20 AM.

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