These forums are in read-only mode. Please see this news post for more information.

New forums can be found here


Go Back   WowAce Forums > General > Lua Code Discussion
Lua Code Discussion You scared? Terrified. Mortified. Petrified. Stupefied... by [coding].

Reply
 
Thread Tools
Old 07-20-2016   #1
Circoo
Member
 
Join Date: Aug 2013
Posts: 44
Smile Frame not visible

Hi this is for my wow addon BGCallouts
In last patch 7.3 my frame is not visible anymore. Also it says that mu addon is out of date but i have no bugs in it. should i wait or can u help me solve this?

If i change the values in frame.texture:SetTexture(0, 0, 0, 1) the frame turns green but i want it black,

Toc file have this row
=============
## Interface: 70300

Here i creat my frame:
===============
local function SetupBGFrame(frame)
frame:SetMovable(true)
frame:EnableMouse(true)
frame:RegisterForDrag("LeftButton")
frame:SetScript("OnDragStart", frame.StartMoving)
frame:SetScript("OnDragStop", frame.StopMovingOrSizing)
-- frame:SetPoint("CENTER", UIParent, "CENTER")
-- The code below makes the frame visible
frame.texture = frame:CreateTexture("ARTWORK")
frame.texture:SetAllPoints()
frame.texture:SetTexture(0, 0, 0, 1)
return frame
end
Circoo is offline   Reply With Quote
Old 07-20-2016   #2
Seerah
Legendary Member
 
Seerah's Avatar
 
Join Date: May 2006
Posts: 6,724
Default Re: Frame not visible

First, your addon shows as being out of date because the Interface number should not be 70300. The current version of WoW is not 7.3, but 7.0. Change that to 70000.

Second, I see you have the SetPoint line for your frame commented out. Do you provide a location for your frame to appear elsewhere in your code? This is a necessary element for a frame to be visible.

Lastly, if your texture appears a neon green color, that means that there is a problem loading the texture itself. (File path incorrect, unsupported dimensions, unsupported file-type, etc.) I haven't heard of issues with SetTexture, and if there were any issues loading the texture, it would be that green color all the time...
__________________
Seerah is offline   Reply With Quote
Old 07-21-2016   #3
Circoo
Member
 
Join Date: Aug 2013
Posts: 44
Default Re: Frame not visible

Hi
thanks now my addon is up to date and i have no bugs in it. But the frame is still green or not visible... Can it have something to do with

frame.texture = frame:CreateTexture("ARTWORK")

You said ...File path incorrect, unsupported dimensions, unsupported file-type, etc.

/thanks
Circoo is offline   Reply With Quote
Old 07-21-2016   #4
Seerah
Legendary Member
 
Seerah's Avatar
 
Join Date: May 2006
Posts: 6,724
Default Re: Frame not visible

I was playing around with something else last night and it seems that :SetTexture() no longer takes r,g,b values. It just wasn't giving an error. Use :SetVertexColor() instead.
__________________
Seerah is offline   Reply With Quote
Old 07-21-2016   #5
Circoo
Member
 
Join Date: Aug 2013
Posts: 44
Default Re: Frame not visible

It still don't work.. and i don't know where to look.. Do you have Another idea?
Circoo is offline   Reply With Quote
Old 07-22-2016   #6
Seerah
Legendary Member
 
Seerah's Avatar
 
Join Date: May 2006
Posts: 6,724
Default Re: Frame not visible

:SetVertexColor worked perfectly fine for me and should for you.

Code:
local function SetupBGFrame(frame)
     frame:SetMovable(true)
     frame:EnableMouse(true)
     frame:RegisterForDrag("LeftButton")
     frame:SetScript("OnDragStart", frame.StartMoving)
     frame:SetScript("OnDragStop", frame.StopMovingOrSizing)
     -- frame:SetPoint("CENTER", UIParent, "CENTER")
     -- The code below makes the frame visible
     frame.texture = frame:CreateTexture("ARTWORK")
     frame.texture:SetAllPoints()
     frame.texture:SetVertexColor(0, 0, 0, 1)     <--change to this
     return frame
end
__________________
Seerah is offline   Reply With Quote
Old 07-22-2016   #7
Circoo
Member
 
Join Date: Aug 2013
Posts: 44
Default Re: Frame not visible

It do not work.. can it be because i play LIVE version of Legion and not PTR version
Circoo is offline   Reply With Quote
Old 07-22-2016   #8
Circoo
Member
 
Join Date: Aug 2013
Posts: 44
Default Re: Frame not visible

Hi
I solved using Backdrop.. it was hard to find "UI-DialogBox-<whatever>" that really linked as i should.
Do you have a list of what possible "backdrop textures" that is avaliable?

local function SetupBGFrame(frame)
frame:SetMovable(true)
frame:EnableMouse(true)
frame:RegisterForDrag("LeftButton")
frame:SetScript("OnDragStart", frame.StartMoving)
frame:SetScript("OnDragStop", frame.StopMovingOrSizing)
frame:SetPoint("CENTER", UIParent, "CENTER")
-- The code below makes the frame visible
frame:SetBackdrop({
bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background-Dark", tile = true, tileSize = 20,
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", edgeSize = 32,
insets = { left = 10, right = 10, top = 10, bottom = 10 }
})
frame:SetBackdropColor(0.8,0.8,0.8,1)
frame:SetBackdropBorderColor(0.8,0.8,0.8,1)
return frame
end
Circoo is offline   Reply With Quote
Old 07-22-2016   #9
Seerah
Legendary Member
 
Seerah's Avatar
 
Join Date: May 2006
Posts: 6,724
Default Re: Frame not visible

You can use any texture in the game, or any texture you create (so long as it follows the guidelines).

I still don't know why you were having issues. You never showed what you had changed the code to (or maybe there was something affecting it somewhere else in your code), or maybe what you put on the forums wasn't your real code. /shrug
__________________
Seerah is offline   Reply With Quote
Old 07-22-2016   #10
Circoo
Member
 
Join Date: Aug 2013
Posts: 44
Default Re: Frame not visible

Hi
ofc it was my real code.. i am not a pro coder but i couldnt find anything else that affected the code. Now it works and i am happy and thank you very much for taking your time to help me. /hug
Circoo is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

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

Forum Jump


All times are GMT. The time now is 03:17 PM.