Quantcast
WoWInterface - View Single Post - Get the texture path from textureID?
View Single Post
03-22-19, 06:24 PM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 500
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:
  1. ActionBar1 = {
  2.     GetTexture = function()
  3.         -- whatever code is here
  4.     end
  5. }

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")
/run TextureFinderFrame:CreateTexture("TextureFinder")
/run TextureFinder:SetTexture(23571)
/run print(TextureFinder:GetTexture())
These commands were "dry coded", which means I have not tested these, but they should work.
  Reply With Quote