Quantcast jpg texture? - WoWInterface
Thread Tools Display Modes
03-21-19, 07:13 AM   #1
wille480
A Wyrmkin Dreamwalker
Join Date: Jan 2017
Posts: 56
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

Last edited by wille480 : 03-21-19 at 07:21 AM.
  Reply With Quote
03-21-19, 07:36 AM   #2
Terenna
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 100
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
  Reply With Quote
03-21-19, 09:24 AM   #3
wille480
A Wyrmkin Dreamwalker
Join Date: Jan 2017
Posts: 56
Originally Posted by Terenna View Post
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 ^^
  Reply With Quote
03-21-19, 09:25 AM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,135
.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"
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
03-21-19, 12:39 PM   #5
Tim
A Frostmaul Preserver
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 274
Also remember it has to be in powers of 2.
ie: 2x2, 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, 256x256, 512x512 and 1024x1024
__________________
AddOns: Tim @ WoWInterface
Characters: Warrior, Shaman, DH, Mage, Pally
Current PC Setup: PCPartPicker List
  Reply With Quote
03-21-19, 12:51 PM   #6
wille480
A Wyrmkin Dreamwalker
Join Date: Jan 2017
Posts: 56
Thanks for the replies everyone!
  Reply With Quote
03-21-19, 01:37 PM   #7
wille480
A Wyrmkin Dreamwalker
Join Date: Jan 2017
Posts: 56
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")
  Reply With Quote
03-21-19, 01:56 PM   #8
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,135
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"
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 03-21-19 at 02:09 PM.
  Reply With Quote
03-21-19, 02:09 PM   #9
wille480
A Wyrmkin Dreamwalker
Join Date: Jan 2017
Posts: 56
Originally Posted by Fizzlemizz View Post
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
  Reply With Quote
03-21-19, 03:27 PM   #10
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,671
Originally Posted by Tim View Post
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.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
03-22-19, 06:29 AM   #11
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,074
Originally Posted by Seerah View Post
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?
  Reply With Quote
03-22-19, 12:10 PM   #12
Tim
A Frostmaul Preserver
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 274
Originally Posted by Seerah View Post
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


Originally Posted by myrroddin View Post
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.
__________________
AddOns: Tim @ WoWInterface
Characters: Warrior, Shaman, DH, Mage, Pally
Current PC Setup: PCPartPicker List

Last edited by Tim : 03-22-19 at 12:13 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Graphics Help » jpg texture?

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