Thread Tools Display Modes
03-30-11, 05:48 AM   #1
weasoug
A Flamescale Wyrmkin
 
weasoug's Avatar
AddOn Author - Click to view addons
Join Date: May 2010
Posts: 127
Exclamation background layer. help

Hey all. was building myself a background for my ui, to sit at the bottom to sort of hold my chat and action buttons. and it works fine. but when i went to do a screen-shot and press alt and z. the background as still showing. any help would be good.

i did try with SetFrameLevel(1) and SetAlpha(1) and SetFrameStrata("LOW") but with no luck.

Code:
local backgroundimg = CreateFrame("frame")
backgroundimg:SetPoint("CENTER", UIParent, "BOTTOMRIGHT", -434, 20)
backgroundimg:SetWidth(1177) 
backgroundimg:SetHeight(380)
backgroundimg:SetBackdrop({bgFile = "interface\\Tooltips\\UI-Tooltip-Background"})
backgroundimg:SetBackdropColor(54/255, 54/255, 54/255)
backgroundimg:Show()
backgroundimg:SetScale(0.8)
__________________
wMmap :: Is a lightweight Minimap, with a sleek look & custom imagery.
wIn1 :: In one addon. and is very lightweight & simple to use.
wChat :: Is a lightweight chat mod.
wBroker :: Is A simple broker add-on.
wPetXPBar :: Is A simple lightweight Pet XP Bar.
wBuffs :: Is A simple Buffs Bar.
  Reply With Quote
03-30-11, 06:03 AM   #2
Ammo
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 17
As far as I know everything parented to UIParent is hidden. So you should do.

local backgroundimg = CreateFrame("frame", nil, UIParent)
  Reply With Quote
03-31-11, 11:20 AM   #3
weasoug
A Flamescale Wyrmkin
 
weasoug's Avatar
AddOn Author - Click to view addons
Join Date: May 2010
Posts: 127
Exclamation

Originally Posted by Ammo View Post
As far as I know everything parented to UIParent is hidden. So you should do.

local backgroundimg = CreateFrame("frame", nil, UIParent)
lol how silly. could i forget not to look at the createframe code. thanks for the help.

also. i wanted to make it move. and it seems to be working.

but when i do a /rl it didn't save the place. i hoped it would save in the layout file.

any help would be great.

Code:
local backgroundimg = CreateFrame("frame", myStuff, UIParent)
backgroundimg:SetPoint("CENTER", UIParent, "BOTTOMRIGHT", -500, 30)
backgroundimg:SetWidth(1177) backgroundimg:SetHeight(380)
backgroundimg:SetBackdrop({bgFile = "interface\\Tooltips\\UI-Tooltip-Background"})
backgroundimg:SetBackdropColor(54/255, 54/255, 54/255)
backgroundimg:Show()
backgroundimg:SetScale(0.8)
backgroundimg:EnableMouse(true)
backgroundimg:SetMovable(true)

backgroundimg:SetScript("OnDragStart", function(self)
  backgroundimg:SetScript("OnDragStop", function (self)
    backgroundimg:SetScript("OnDragStop", nil)
    backgroundimg:StopMovingOrSizing()
  end)
  if IsShiftKeyDown() then 
  backgroundimg:StartMoving()
end
end)
backgroundimg:RegisterForDrag("LeftButton")
__________________
wMmap :: Is a lightweight Minimap, with a sleek look & custom imagery.
wIn1 :: In one addon. and is very lightweight & simple to use.
wChat :: Is a lightweight chat mod.
wBroker :: Is A simple broker add-on.
wPetXPBar :: Is A simple lightweight Pet XP Bar.
wBuffs :: Is A simple Buffs Bar.

Last edited by weasoug : 03-31-11 at 11:25 AM.
  Reply With Quote
03-31-11, 11:56 AM   #4
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
The script handlers are a bit strange.

Try

Code:
backgroundimg:SetScript("OnDragStart", function(self) if IsShiftKeyDown() then  self:StartMoving() end end)
backgroundimg:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)
  Reply With Quote
03-31-11, 12:15 PM   #5
weasoug
A Flamescale Wyrmkin
 
weasoug's Avatar
AddOn Author - Click to view addons
Join Date: May 2010
Posts: 127
Exclamation

Originally Posted by Duugu View Post
The script handlers are a bit strange.

Try

Code:
backgroundimg:SetScript("OnDragStart", function(self) if IsShiftKeyDown() then  self:StartMoving() end end)
backgroundimg:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)
yes i have tried that way also. but i had to add the RegisterForDrag still. and i also added SetUserPlaced as i read that is what makes it save to the layout. like

Code:
local backgroundimg = CreateFrame("frame", myStuff, UIParent)
backgroundimg:SetPoint("CENTER", UIParent, "BOTTOMRIGHT", -500, 30)
backgroundimg:SetWidth(1177) backgroundimg:SetHeight(380)
backgroundimg:SetBackdrop({bgFile = "interface\\Tooltips\\UI-Tooltip-Background"})
backgroundimg:SetBackdropColor(54/255, 54/255, 54/255)
backgroundimg:Show()
backgroundimg:SetScale(0.8)
backgroundimg:EnableMouse(true)
backgroundimg:SetMovable(true)

backgroundimg:SetScript("OnDragStart", function(self) if IsShiftKeyDown() then  self:StartMoving() end end)
backgroundimg:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)

backgroundimg:SetUserPlaced(true)
backgroundimg:RegisterForDrag("LeftButton")
__________________
wMmap :: Is a lightweight Minimap, with a sleek look & custom imagery.
wIn1 :: In one addon. and is very lightweight & simple to use.
wChat :: Is a lightweight chat mod.
wBroker :: Is A simple broker add-on.
wPetXPBar :: Is A simple lightweight Pet XP Bar.
wBuffs :: Is A simple Buffs Bar.
  Reply With Quote
03-31-11, 07:36 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
you're missing :SetUserPlaced(true)
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » background layer. help


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off