ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Just want a window with a black background (https://www.esoui.com/forums/showthread.php?t=10712)

robert.labrie 10/20/23 05:41 PM

Just want a window with a black background
 
Does anyone have an example of doing a control with a plain black background? I swear I'm trying but not getting it. I assume it goes in the backdrop with centerColor and edgeColor but if I don't inherit a backdrop it doesn't render anything and if I do then it just looks like the backdrop. I'll work out the anchors and starting position and the rest I just want a black box to put labels in right now.

I'm a sysadmin, not a front end dev, please take pity on me.

Thanks,
Robert

Baertram 10/21/23 06:41 AM

Hi Robert,

you can try to use this virtual backdrop here, it looks black see-through with a small thin border around it:

Code:

<GuiXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sir.insidi.at/or/schema/esoui.xsd">
<Controls>
                <Backdrop name="DarkThinFrameBackdrop" inherits="ZO_DarkThinFrame" virtual="true" tier="LOW" layer="BACKGROUND" level="0">
                        <Anchor point="TOPLEFT" offsetX="-4" offsetY="-4"/>
            <Anchor point="BOTTOMRIGHT" offsetX="4" offsetY="4"/>
            <Edge file="EsoUI/Art/Miscellaneous/dark_edgeFrame_8_thin.dds" edgeFileWidth="64" edgeFileHeight="8" />
            <Center file="EsoUI/Art/Miscellaneous/Gamepad/gp_edgeFill.dds" />
        </Backdrop>



</Controls>

</GuiXML>


Then create a TopLevelControl and at it's <Controls> add this e.g.

Code:

<TopLevelControl name="MyUI_TLC_Keyboard">
            <Dimensions x="900" y="600"/>
            <DimensionConstraints minX="900" minY="600"/>
            <Anchor point="CENTER" relativeTo="GuiRoot" relativePoint="CENTER" offsetX="0" offsetY="0"/>
<!-- Background -->
                            <Backdrop name="$(parent)BG" alpha="1" inherits="DarkThinFrameBackdrop" centerColor="666666">
                                    <AnchorFill/>
                                </Backdrop>

  </Controls>
        </TopLevelControl>

I bet there also is an easy way to craete just a plain black backdrop but I never did, so I'm not quite sure how to do it.
Maybe you can change the above line
<Backdrop name="$(parent)BG" alpha="1" inherits="DarkThinFrameBackdrop" centerColor="666666">
to use 000000 as center color.


Edit:
The ZO_DarkThinFrame backdrop with centerColor="666666" looks like this

robert.labrie 10/21/23 07:23 PM

Deleted my other responses, thanks Baertram I took your example and modded a bit more am good to go. Any idea how to hid the frame border? Votan does it in lua like this

frame:SetHidden(true)

Not critical, looks way better now than when I started so thanks again so much for your help!

Baertram 10/22/23 05:55 AM

frame:SetHidden(true) would only work if you got an extra control e.g. <control name="$(parent)Frame" ... /> and have assigned it in lua via
local frame = MyUI_TLC_Keyboard:GetNamedChild("Frame")

But as this is not the case, and the frame is only a texture <Edge file="....

Try if commenting this line will remove the frame texture around it:
<!-- <Edge file="EsoUI/Art/Miscellaneous/dark_edgeFrame_8_thin.dds" edgeFileWidth="64" edgeFileHeight="8" /> -->


All times are GMT -6. The time now is 03:37 PM.

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