View Single Post
01-31-13, 03:06 PM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Actually, they need to be backslashes, not forward slashes, but you are correct that they need to be escaped, and that the path must be relative to the WoW program folder, not the addon's folder. The escaping (doubling) is necessary because Lua treats a single backslash as the beginning of an escape sequence; for example "\n" indicates a line break, "\t" indicates a tab, etc. If you want a literal backslash, you have to escape it with a second backslash.

Also, the file extension doesn't need to be included.

Finally, you should avoid using PNG images, because they only work in the Mac client. Save them straight to TGA in Photoshop/GIMP/whatever, or save them as PNG and then convert them to BLP.

Code:
dice:SetImage("Interface\\Addons\\MyAddon\\icon")
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote