-
Posted by uitat on Mon, 15 Oct 2012 16:37:15
ok in this i am attempting to make the frame out of the Guild Bank Halves, yep i succeeded the problem is now that i cant move it at all i am really frustrated here and could use all the help possible, i have delved into the book to find all of this info, most of which was available in chapter 9 anyone see where my problem is???
-- Creating Background Frame Named D_Config_Main CreateFrame("frame", "D_Config_Main", UIParent) D_Config_Main:SetWidth(1024) D_Config_Main:SetHeight(512) D_Config_Main:SetPoint("CENTER", UIParent,"CENTER") D_Config_Main:SetFrameStrata("BACKGROUND") function D_Config_Main_OnLoad(self) SetPortraitToTexture(self.portrait, "Interface\\Icons\\INV_Misc_EngGizmos_30") D_Config_Main_MakeMovable(self) end function D_Config_Main_MakeMovable(frame) D_Config_Main:EnableMouse(true) D_Config_Main:SetMovable(true) D_Config_Main:RegisterForDrag("LeftButton") D_Config_Main:SetScript("OnDragStart", frame.StartMoving) D_Config_Main:SetScript("OnDragStop", frame.StopMovingOrSizing) end -- Setting The Background Image For D_Config_Main for left side D_Config_Main.portrait = D_Config_Main:CreateTexture("D_Config_Main_Portrait", "BACKGROUND") D_Config_Main.portrait:SetWidth(512) D_Config_Main.portrait:SetHeight(512) D_Config_Main.portrait:SetPoint("TOPLEFT", 0, 0) D_Config_Main.portrait:SetTexture("Interface\\GuildBankFrame\\UI-GuildBankFrame-Left") -- Setting the background for D_Config_Main for Right side D_Config_Main.portrait = D_Config_Main:CreateTexture("D_Config_Main_Portrait", "BACKGROUND") D_Config_Main.portrait:SetWidth(512) D_Config_Main.portrait:SetHeight(512) D_Config_Main.portrait:SetPoint("TOPRIGHT", 0, -11) D_Config_Main.portrait:SetTexture("Interface\\GuildBankFrame\\UI-GuildBankFrame-Right")
-
Posted by jnwhiteh on Mon, 15 Oct 2012 18:04:46
I'm not sure that a frame can be registered as draggable, I think it needs to be a button if you want that, but its been three years since I wrote that chapter. Have you added debug statements to ensure your OnDragStart and OnDragStop functions are being called?
-
Posted by uitat on Mon, 15 Oct 2012 18:21:33
no i have not and nor do i know how to do debug scripting yet
-
Posted by jnwhiteh on Mon, 15 Oct 2012 18:39:30
Add print statements to see if your code is being called. It's probably the easiest method of debugging.