ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   I know this is a Simple XML transparent question but need some help. (https://www.esoui.com/forums/showthread.php?t=2352)

zireko 10/26/14 08:41 AM

I know this is a Simple XML transparent question but need some help.
 
All I'm trying to do is make this transparent when I delete it , it gives me a white box background.
I tried to look for the api for backdrops and couldn't find them in the main api list , also I tried looking it up in zgoo but I may just be looking in the wrong places.

inherits="ZO_ThinBackdrop"

here is my xml currently

Lua Code:
  1. <GuiXml>
  2.     <Controls>
  3.         <TopLevelControl name="QuestLurker" mouseEnabled="true" movable="true" hidden="false" resizeToFitDescendents="true">       
  4.                 <Controls>
  5.                 <Backdrop name="$(parent)BG" inherits="ZO_ThinBackdrop" excludeFromResizeToFitExtents="true">
  6.                     <AnchorFill />
  7.                 </Backdrop>
  8.                
  9.                 <Label name="$(parent)Quest" font="ZoFontWindowTitle" color="CFDCBD" wrapMode="ELLIPSIS" verticalAlignment="CENTER" horizontalAlignment="CENTER">
  10.                     <Anchor point="CENTER" realtiveTo="$(parent)" realtivePoint="CENTER" offsetX="0" offsetY="0" />
  11.                 </Label>
  12.             </Controls>
  13.         </TopLevelControl>
  14.     </Controls>
  15. </GuiXml>

Garkin 10/26/14 09:55 AM

If you want to make any control transparent in LUA, use SetAlpha(value), where value is number between 0 (transparent) and 1 (fully opaque).
lua Code:
  1. QuestLurkerBG:SetAlpha(0.3)
Or you can completely hide control using SetHidden(true).
lua Code:
  1. QuestLurkerBG:SetHidden(true)

If you want set transparency in XML use alpha="value". This example sets transparency for backdrop to 30%:
lua Code:
  1. <Backdrop name="$(parent)BG" inherits="ZO_ThinBackdrop" alpha="0.3" />
To completely hide control in XML use hidden="true":
lua Code:
  1. <Backdrop name="$(parent)BG" inherits="ZO_ThinBackdrop" hidden="true" />

zireko 10/26/14 11:42 AM

Thank you Garkin it's working perfect now.

circonian 10/27/14 01:04 AM

If you want to hide the entire control do what Garkin suggested.
But, just fyi there may be a case sometimes when you don't want to hide the entire control.

For example if you had a backdrop & you only wanted to see the border, but not the rest (center) of the control you could set its center color
Lua Code:
  1. centerColor="00000000"

and that would make the center transparent, but the border would still be visible.


All times are GMT -6. The time now is 06:33 PM.

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