Quantcast [tech]images/content inclusion - ESOUI
Thread Tools Display Modes
02/26/14, 05:38 PM   #1
Nyro
 
Nyro's Avatar
Join Date: Feb 2014
Posts: 7
[tech]images/content inclusion

Seems I'm the first to post, I hope it does worth it.
I was wandering on the internet wondering if and how it would be possible to insert custom images, like a guild banner a start (even if it's not necessarily the world best add-on, I agree on that).
Now that it's been posted I can continue my research in peace, i guess.
Thanks in advance.
__________________
Having doubts ? Reboot !
  Reply With Quote
02/26/14, 09:20 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 651
I've tried to use a custom graphic myself and was so far unsuccessful...
  Reply With Quote
02/26/14, 11:50 PM   #3
Nyro
 
Nyro's Avatar
Join Date: Feb 2014
Posts: 7
Did you try with the function below ?
* SetTexture (string filename)
If not, what did you try ?
In any case, were you able to find out what was the problem ? A relative/absolute path misleading ? Permission problem ? Were did you put you image ?
i'm sorry, but I'm curious and slightly enthousiastic.
__________________
Having doubts ? Reboot !

Last edited by Nyro : 02/26/14 at 11:52 PM.
  Reply With Quote
02/27/14, 08:46 AM   #4
zork
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 29
*edit*
See below.
__________________
| Simple is beautiful.
| ESOUI GoogleCode | ROTHUI GoogleCode | WoWInterface | Guild | zorker.de

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 02/28/14 at 02:08 AM.
  Reply With Quote
02/27/14, 10:01 PM   #5
SinusPi
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 18
You can put DDS files alongside your addon, if you only :SetTexture("YourAddonFolder/file.dds") .
  Reply With Quote
02/28/14, 02:07 AM   #6
zork
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 29
That simple.
__________________
| Simple is beautiful.
| ESOUI GoogleCode | ROTHUI GoogleCode | WoWInterface | Guild | zorker.de

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
02/28/14, 12:56 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 651
I was trying with a file path that started at the EsoUI level, like it works in the default UI files. I will have to try again with starting the path at just the addon folder. Thanks.
  Reply With Quote
02/28/14, 01:33 PM   #8
Nyro
 
Nyro's Avatar
Join Date: Feb 2014
Posts: 7
Thanks a lot for your answers.
Last step is dealing with vertex objects I guess.
__________________
Having doubts ? Reboot !
  Reply With Quote
03/01/14, 03:52 AM   #9
Visur
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 6
I'm trying to load a dds file too.
Any problem to load a dds already in the client ("/esoui/art…") but impossible to load my dds.
It's just a 32x32 png converted in dds with the photoshop plugin. I try different options (DXT, 8.8.8.8, etc…) but it's doesn't work.
For the path I use something like : "MyAddonName/Img/Myfile.dds", with a Img folder in my addon.

Do you have some dds file already working to share please ?
  Reply With Quote
03/01/14, 07:08 AM   #10
zork
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 29
I will give it a try.

*edit*

I will upload my first addon in a second. It shows how to work with textures and controls.

For a first view check:
http://code.google.com/p/zork-esoui/...extureTest.lua

When saving a DDS file choose DXT5 ARGB.


Result:


The green shield texture is the default one. The purple one I made myself.

*edit 2*

Addon is available here: http://www.esoui.com/downloads/info33-zTextureTest.html

The simplest texture integration can be done via:
lua Code:
  1. --window manager
  2.       local wm = GetWindowManager()
  3.      
  4.       local c = wm:CreateTopLevelWindow(nil)
  5.       c:SetDimensions(128,128)
  6.       c:SetAnchor(CENTER,GuiRoot,CENTER,0,0)
  7.      
  8.       --texture referencing a local media folder
  9.       c.icon = wm:CreateControl(nil, c, CT_TEXTURE)
  10.       c.icon:SetTexture("zTextureTest/media/purple_shield.dds")
  11.       c.icon:SetAnchorFill(c)
__________________
| Simple is beautiful.
| ESOUI GoogleCode | ROTHUI GoogleCode | WoWInterface | Guild | zorker.de

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 03/01/14 at 11:24 AM.
  Reply With Quote
03/02/14, 10:48 AM   #11
Visur
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 6
Thanks for the code.
  Reply With Quote
03/21/14, 02:50 PM   #12
Biki
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 34
Does it absolutely need to be a DDS? I seem to have some conversion errors when converting from PNG to DDS.

Last edited by Biki : 03/21/14 at 02:59 PM.
  Reply With Quote
03/21/14, 03:34 PM   #13
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
Iirc, dds files have an alpha channel for opacity, which is required. PNG doesn't have that, although it can do transparencies, so should be easy to make.
__________________
Knights who say Ni!

"Blaming addons for bad behavior of people is like blaming the getaway car for the bank robbery."
  Reply With Quote
03/31/14, 04:57 AM   #14
Tajin
 
Tajin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 29
Originally Posted by Vuelhering View Post
PNG doesn't have that, although it can do transparencies, so should be easy to make.
That depends on the type of png.
PNG32 does have an alpha channel.
  Reply With Quote

ESOUI » Developer Discussions » Graphics Help » [tech]images/content inclusion

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