Get the texture path from textureID?
I've been searching all over, knowing I missed something basic. I know the following returns the path to the texture, but only if you already know the texture's name, ie: it's a string.
Code:
local ActionBar1:GetTexture() -- should work |
This is a part of Lua. GetTexture in this case is a method, a function as a value of a key in a table. ActionBar1 is a table set up with the methods of a standard frame. Frames are a WoW-specific thing, tables set up with a standard set of methods and a metatable.
Lua Code:
Using the following chat command will print the word "table" into your chat window: /run print(type(ActionBar1)) And this will print the word "nil", which means you'll get an error if you try to use a method with it: /run print(type(23571)) My suggestion would be to create a frame, create a texture with it, use SetTexture with the textureID, then use GetTexture on that frame. Here's the following steps to do this just from chat commands, one at a time: Code:
/run TextureFinderFrame = CreateFrame("frame") |
That's a great solution. Make a temp frame, set the texture, get the texture path. Why didn't I think of that?
|
Well, sometimes GetTexture() returns texture IDs, but other times it returns texture paths, whichever is available, I guess, you can't be 100% sure.
There's GetTextureFileID and GetTextureFilePath, however, they don't really work the way one'd expect them to work. If you passed an ID to SetTexture, GetTextureFilePath will return the object itself O_o (I assume that's a bug, it should return nil, I'll report it on Monday), GetTextureFileID will return that ID, if you passed a path to SetTexture, GetTextureFileID will return nil, GetTextureFilePath will return that path. There's this lovely thing though: https://www.townlong-yak.com/framexm...tTextureID.lua |
All times are GMT -6. The time now is 04:09 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI