WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Relative path file (https://www.wowinterface.com/forums/showthread.php?t=59556)

Benalish 04-15-23 07:03 AM

Relative path file
 
Hello. In the folder where the .lua, .xml and .toc files are present, there is a subfolder called "media" where the "thumb.blp" file is present. What is the right syntax to load this file? I tried



"media\\thumb"

"\\media\\thumb"

"..\\media\\thumb"



but none of them work. Do I have to write the whole path?

Fizzlemizz 04-15-23 09:01 AM

Code:

"Inteface\\AddOns\\Your-Addon-Folder\\Media\\Thumb"
or create a variable for the textures path

Code:

local TexturePath = "Inteface\\AddOns\\Your-Addon-Folder\\Media\\"
and use
Code:

thisTexture:SetTexture(TexturePath .. "Thumb")


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

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