ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Why my texture is only fully yellow? (https://www.esoui.com/forums/showthread.php?t=7032)

vvarderen 05/13/17 05:06 AM

Why my texture is only fully yellow?
 
Hello evreybody,

I created the following texture on my textures folder in \myaddon\textures:

in DXT5, size 64x64, with alpha chanel

But I have this result on the screen:


I don't understand.

this is my code in control.lua
Lua Code:
  1. local monsterDiff = container.monsterDiff or WINDOW_MANAGER:CreateControl(nil,container,CT_TEXTURE)
  2.     monsterDiff:SetDimensions(64,64)
  3.     monsterDiff:ClearAnchors()
  4.     monsterDiff:SetAnchor(TOP,name,BOTTOM,0,10)
  5.     container.monsterDiff = monsterDiff
  6.  
  7. local iconCFG = self.textures
  8.  
  9.         nameplate.monsterDiff:SetHidden(false)
  10.         nameplate.monsterDiff:SetTexture(iconCFG.defaultboss[normal])
  11.         nameplate.monsterDiff:SetColor(240,100,0,1)


and code in textures.lua
Lua Code:
  1. defaultboss = {
  2.         normal      = Myaddon.name .. '/textures/bossicon1.dds',
  3. }

Do you have an idea?

Thank's you.

Shinni 05/13/17 05:44 AM

Your texture could not be loaded, so it is displayed as a white box. The white box is tinted yellow because of
nameplate.monsterDiff:SetColor(240,100,0,1)

The texure could not be loaded because iconCFG.defaultboss[normal] returns nil in your code.
Lua Code:
  1. defaultboss = {
  2.             normal      = Myaddon.name .. '/textures/bossicon1.dds',
  3.     }
This lua code means the table defaultboss has a field called normal, which contains the path to the texture. However, when calling defaultboss[normal] lua will interpret normal as a variable and not the name of the field.
You need to call iconCFG.defaultboss.normal or iconCFG.defaultboss["normal"]

vvarderen 05/13/17 05:54 AM

I understand better. Thank you very much for your help.

Indeed, it works better. :)


All times are GMT -6. The time now is 02:05 AM.

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