Thread Tools Display Modes
05/13/17, 05:06 AM   #1
vvarderen
 
vvarderen's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 20
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.

Last edited by vvarderen : 05/13/17 at 05:11 AM.
  Reply With Quote
05/13/17, 05:44 AM   #2
Shinni
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 167
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"]
  Reply With Quote
05/13/17, 05:54 AM   #3
vvarderen
 
vvarderen's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 20
I understand better. Thank you very much for your help.

Indeed, it works better.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Why my texture is only fully yellow?

Thread Tools
Display Modes

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