Thread Tools Display Modes
Prev Previous Post   Next Post Next
04/29/14, 01:53 PM   #1
ZunaSW
Join Date: Mar 2014
Posts: 37
Making a texture hidden and not hidden if...

Hi. Sorry my english : )
I'm not sure how to do this, I know it can be done, but I'm not sure if I'm going well or I'm doing it wrong. Here is what I want to do:

My texture will be always hidden, but when the stamina is below 10% the texture will be shown. This is how I put the texture:

Code:
-- Barra de Aguante
  local wm = GetWindowManager()
  local c = wm:CreateTopLevelWindow(nil)
  c:SetDimensions(1024,128)
  c:SetAnchor(BOTTOM,GuiRoot,BOTTOM,0,0)
  --Textura de la barra de aguante
  c.icon = wm:CreateControl(nil, c, CT_TEXTURE)
  c.icon:SetTexture("Addon/tex/tex1.dds")
  c.icon:SetAnchorFill(c)
I used this "tutorial" and now I can understand how to put textures: http://www.esoui.com/downloads/info33-zTextureTest.html But not how to "call" them to do something later. I'm not sure if I'm explaining well what I want to say. In some moment you will have to "call" your texture to be shown, for example in Papyrus of Skyrim (I'll put a example similar of what I want to do in the Addon):
Code:
Event OnCellLoad()
	MyNPC.enable()
EndEvent
That "MyNPC" is "called" in a property. And I'm trying to find something like that, I know you can't do it because this is not the Creation Kit and this is all write and write and write codes, but it has to be a way to call that texture, and then it will become possible to shown or not shown. I tried with this:

Code:
local function SHStaminaBar()
-- Barra de Aguante
	local wm = GetWindowManager()
	local c = wm:CreateTopLevelWindow(nil)
	local staminabar = SHStamina(WINDOW_MANAGER:CreateTopLevelWindow("stamina") )
		 staminabar:SetHidden(true)
		 staminabar:SetDimensions(1024,128)
                 staminabar:SetAnchor(BOTTOMRIGHT,GuiRoot,BOTTOMRIGHT,0,0)
		 staminabar:SetTexture("Addon/tex/tex1.dds")
		 staminabar:SetAnchorFill(c)
		 staminabar:SetAlpha(1.0)
		if (ZO_PlayerAttributeStamina < 10)
			staminabar:SetHidden(false)
		end	 
 return window
end
But no way, it's giving me an error for that "staminabar:SetHidden(false)".
How to do this?

Thanks!
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » Making a texture hidden and not hidden if...


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