WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Graphics Help (https://www.wowinterface.com/forums/forumdisplay.php?f=14)
-   -   jpg texture? (https://www.wowinterface.com/forums/showthread.php?t=57076)

wille480 03-21-19 07:13 AM

jpg texture?
 
Hello, So i am trying to set a texture frame to a .jpg image file beside my frame. Is there something special i have to do? With my current code it only displays a green box where the image should be at.

Lua Code:
  1. local tec = k:CreateTexture(nil,"OVERLAY")
  2.     tec:SetPoint("RIGHT")
  3.     tec:SetSize(50,50)
  4.     tec:SetTexture("C:\\Program Files (x86)\\World of Warcraft\\_retail_\\Interface\\AddOns\\ownAddon\\icons\\fear.jpg")

this is how it looks: https://gyazo.com/05493ffe4b4c163bd86e5613c2a159df

Terenna 03-21-19 07:36 AM

I'm pretty sure you can't use jpg and would need tga. But also try removing C:\\Program Files (x86)\\World of Warcraft\\_retail_\\ from your path file. All you need is the stuff including and after Interface

wille480 03-21-19 09:24 AM

Quote:

Originally Posted by Terenna (Post 331745)
I'm pretty sure you can't use jpg and would need tga. But also try removing C:\\Program Files (x86)\\World of Warcraft\\_retail_\\ from your path file. All you need is the stuff including and after Interface

Oh okay so it has to be tga, damn! ye i was just testing for sure that's why i put the whole path ^^

Fizzlemizz 03-21-19 09:25 AM

.tga or .blp texture formats only.
BLP2PNG or BLPNG Converter are tools for converting to/from .blp and .png

As mentioned file paths start with "Interface\\" as in "Interface\\Addons\\Myaddon\\MyTexture"

You can use \\ or / in your .lua path name "Interface/Addons/Myaddon/MyTexture"

Tim 03-21-19 12:39 PM

Also remember it has to be in powers of 2.
ie: 2x2, 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, 256x256, 512x512 and 1024x1024

wille480 03-21-19 12:51 PM

Thanks for the replies everyone!

wille480 03-21-19 01:37 PM

I now have this code but it is still just showing a green box like first gyazo picture :O . I did check if there was something wrong with the "fear.tga" file itself and grabbed a quick icon from elvui package but that did not work either.

Lua Code:
  1. local tec = k:CreateTexture(nil,"OVERLAY")
  2.     tec:SetPoint("RIGHT")
  3.     tec:SetSize(32, 32)
  4.     tec:SetTexture("Interface/AddOns/ownAddon/icons/fear.tga")

Fizzlemizz 03-21-19 01:56 PM

Images requirements

try using "Interface/BUTTONS/WHITE8X8" for the texture.

If you add a file (including images or code) to to your addons you ,must completely exit and re-start the game before they will be "recognised"

wille480 03-21-19 02:09 PM

Quote:

Originally Posted by Fizzlemizz (Post 331753)
Images requirements

try using "Interface/BUTTONS/WHITE8X8" for the texture.

If you add a file (including images) to to you addons you ,must completely exit and re-start the game before they will be "recognised"

That explains it .. The game was not relaunched, thats why it did not show. I restarted the game and it is working fine with my original. Thanks anyways mate

Seerah 03-21-19 03:27 PM

Quote:

Originally Posted by Tim (Post 331750)
Also remember it has to be in powers of 2.
ie: 2x2, 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, 256x256, 512x512 and 1024x1024

Just a reminder that images don't have to be square. ;)

myrroddin 03-22-19 06:29 AM

Quote:

Originally Posted by Seerah (Post 331755)
Just a reminder that images don't have to be square. ;)

I was just going to say that! They have to be powers of 2, so 2x4, 512x1024, 256x128, 64x32, etc, are all fine to use. I think there is an upper maximum, but I don't know what it might be. Obviously 2x2 is the smallest, but is 1024x1024 the largest?

Tim 03-22-19 12:10 PM

Quote:

Originally Posted by Seerah (Post 331755)
Just a reminder that images don't have to be square. ;)

Oh I know but, I guess I should've been a little more elaborate for the new guy. :P


Quote:

Originally Posted by myrroddin (Post 331759)
I was just going to say that! They have to be powers of 2, so 2x4, 512x1024, 256x128, 64x32, etc, are all fine to use. I think there is an upper maximum, but I don't know what it might be. Obviously 2x2 is the smallest, but is 1024x1024 the largest?

I don't think they've adjusted it to support anything bigger but, I could be wrong.


All times are GMT -6. The time now is 09:26 PM.

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