View Single Post
04-21-09, 06:29 PM   #11
Nubsy
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 14
Hi ive bn fidling around with this but get it to work i keep getting

interface\addons\oUF_nubsy\oUF_nubsy.lau:536UF_TargetDragFrame:SetPoint(): Unkown Region Point

at first i got it to work but couldnt get rid of the drag boxes then this happened can some 1 please help ?

my code
-- spawns
`local player = oUF:Spawn("player", "oUF_Player")
local target = oUF:Spawn("target", "oUF_Target")
local pet = oUF:Spawn("pet", "oUF_pet")
local tt = oUF:Spawn("targettarget")
tt:SetPoint("TOPRIGHT", target, "BOTTOMRIGHT", 0, -1)

-- move func
local function oUF_MoveThisFrame(frame,moveit,lock)
local f = _G[frame]
if moveit == 1 then
f:SetMovable(true)
f:SetUserPlaced(true)
if lock ~= 1 then
f:EnableMouse(true)
f:RegisterForDrag("RightButton")
f:SetScript("OnDragStart", function(self) self:StartMoving() end)
f:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)
end
else
f:IsUserPlaced(false)
end
end

-- create drag frame func
local function oUF_CreateDragFrame(framename,movable,locked,anchorframe,anchorframename,anchorpoint,xpos,ypos)
local f = CreateFrame("Frame",framename,UIParent)
f:SetWidth(50)
f:SetHeight(50)
if locked ~= 1 then
f:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background", edgeFile = "", tile = true, tileSize = 16, edgeSize = 16, insets = { left = 0, right = 0, top = 0, bottom = 0 }})
end
f:SetPoint(anchorpoint,xpos,ypos)
f:SetFrameStrata("DIALOG")
if anchorframe == nil then
anchorframe = _G[anchorframename]
end
anchorframe:ClearAllPoints()
anchorframe:SetPoint("TOPLEFT", f, "TOPLEFT",0,0)
oUF_MoveThisFrame(framename,movable,locked)
end


--calls
-- oUF_CreateDragFrame(framename,movable,locked,anchorframe,anchorframename,anchorpoint,xpos,ypos)
oUF_CreateDragFrame("oUF_TargetDragFrame",1,0,target_area_dragable,target_area_locked,"oUF_Target","CENTER",1,0)
oUF_CreateDragFrame("oUF_PlayerDragFrame",1,0,player_area_dargable,player_area_locked,"oUF_Player","CENTER",1,0)
oUF_CreateDragFrame("oUF_PetDragFrame",1,0,pet_area_dragable,pet_area_locked,"oUF_Pet","CENTER",1,0)

Last edited by Nubsy : 04-21-09 at 06:33 PM.
  Reply With Quote