ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Graphics Help (https://www.esoui.com/forums/forumdisplay.php?f=176)
-   -   [tech]images/content inclusion (https://www.esoui.com/forums/showthread.php?t=122)

Nyro 02/26/14 05:38 PM

[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.

Seerah 02/26/14 09:20 PM

I've tried to use a custom graphic myself and was so far unsuccessful...

Nyro 02/26/14 11:50 PM

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. :p

zork 02/27/14 08:46 AM

*edit*
See below.

SinusPi 02/27/14 10:01 PM

You can put DDS files alongside your addon, if you only :SetTexture("YourAddonFolder/file.dds") .

zork 02/28/14 02:07 AM

That simple. :)

Seerah 02/28/14 12:56 PM

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. :)

Nyro 02/28/14 01:33 PM

Thanks a lot for your answers.
Last step is dealing with vertex objects I guess.

Visur 03/01/14 03:52 AM

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 ?

zork 03/01/14 07:08 AM

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)

Visur 03/02/14 10:48 AM

Thanks for the code. :)

Biki 03/21/14 02:50 PM

Does it absolutely need to be a DDS? I seem to have some conversion errors when converting from PNG to DDS.

Vuelhering 03/21/14 03:34 PM

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.

Tajin 03/31/14 04:57 AM

Quote:

Originally Posted by Vuelhering (Post 1608)
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.


All times are GMT -6. The time now is 03:21 AM.

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