WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   ButtonTexture not loading (https://www.wowinterface.com/forums/showthread.php?t=36401)

samishii23 10-30-10 03:55 PM

ButtonTexture not loading
 
Code:

SK.Frame = CreateFrame("Frame", "SK Test")
SK.Frame:SetFrameStrata("TOOLTIP")
SK.Frame:SetWidth(100)
SK.Frame:SetHeight(100)
SK.Frame:SetPoint("CENTER",0,0)
SK.Frame:SetBackdrop(SK_Styles.Main)
SK.Frame:SetBackdropColor(Color("Red"))
SK.Frame:SetScript("OnEvent", SK.Events)
SK.Frame:Hide()

local button = CreateFrame("Button",nil,SK.Frame)
button:SetBackdrop(SK_Styles.Main)
button:SetPoint("TOPRIGHT")
button:SetHeight(32)
button:SetWidth(32)
button:SetNormalTexture("Interface\Buttons\UI-Panel-MinimizeButton-Up")
button:SetPushedTexture("Interface\Buttons\UI-Panel-MinimizeButton-Down")
button:SetHighlightTexture("Interface\Buttons\UI-Panel-MinimizeButton-Highlight", "ADD")
button:SetScript("OnClick", function() SK.Frame:Hide() end)

It don't show the texture... Help?

Seerah 10-30-10 06:55 PM

You need to escape the slashes in your file paths, or else Lua will skip right over them when reading through.
Code:

button:SetNormalTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Up")
button:SetPushedTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Down")
button:SetHighlightTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Highlight", "ADD")


samishii23 10-30-10 07:50 PM

Is there a major programming difference between " and ' in LUA? ( I primarily code PHP, and " allows for variables to be inserted and escape characters to be used, while ' is a litteral )
Thanks! :)

Xubera 10-30-10 09:57 PM

no, " and ' work the same

however there is a token that allows for that

[[Interface\Addons\MyAddon\media\myTexture]]

and

[=[Interface\Addons\MyAddon\media\myTexture]=]

just make sure there are as many equals on both sides, i dont know if theres a limit too it, but you probably wont need that many :)


All times are GMT -6. The time now is 04:38 PM.

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