Thread Tools Display Modes
09-02-12, 02:37 PM   #1
Cirbafe
A Defias Bandit
Join Date: Sep 2012
Posts: 3
Smile Help CreateFrame()

i'm learning how to create a frame but i only get a green screen with this code

Lua Code:
  1. CreateFrame("Frame", "Fit", UIParent)
  2. Fit:SetSize(160, 20)
  3. Fit:SetPoint("CENTER")
  4.  
  5. WoWProFit:SetBackdrop( {
  6.     bgFile = "Interface\Tooltips\UI-Tooltip-Background",
  7.     tile = true,
  8.     tilesize = 16,
  9.     edgeFile = "Interface\Tooltips\UI-Tooltip-Border",
  10.     edgeSize = 16,
  11.     insets = { left = 4, right = 3, top = 4, bottom = 3}
  12.     } )
  13. Fit:SetBackdropColor(0.2,0.2,0.2,0.7)

where's is the problem?
  Reply With Quote
09-02-12, 02:45 PM   #2
Cirbafe
A Defias Bandit
Join Date: Sep 2012
Posts: 3
Found the problem

wrong bgFile and edgeFile path,

Interface\Tooltips... wrong
Interface\\Tooltips... correct >.<
  Reply With Quote
09-02-12, 02:47 PM   #3
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
Lua Code:
  1. self.FlareFrame = CreateFrame("Frame", "MUI_Flares", UIParent)
  2. self.FlareFrame:SetSize(20,20)
  3. self.FlareFrame:SetBackdrop({
  4.     bgFile = "Interface/DialogFrame/UI-DialogBox-Background",
  5.     edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
  6.     tile = true, tileSize = 32, edgeSize = 16,
  7.     insets = { left = 1, right = 1, top = 1, bottom = 1 }
  8.   })

It looks like the problem is the \ character (it means "ignore following char") so either use a / (see above example) or a \\ (so that it ignores processing the 2nd 'ignore next' character. It's green b/c it can't fine the image b/c it isn't reading the path the way you think it's reading the path

Edit: So, I sat here typing all that and you have the temerity to find the problem while I'm trying to post? I hope gnomes nibble your knees down to nubs.
  Reply With Quote
09-02-12, 03:14 PM   #4
Sharparam
A Flamescale Wyrmkin
 
Sharparam's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 102
Originally Posted by VincentSDSH View Post
(it means "ignore following char")
Not quite, I'm not sure how to explain it though, so I'll just link the wikipedia article

Escape Character - Wikipedia
  Reply With Quote
09-02-12, 03:23 PM   #5
Cirbafe
A Defias Bandit
Join Date: Sep 2012
Posts: 3
I'm in trouble now include a button inside the window
beside the button and a simple text, how can I do this?
  Reply With Quote
09-02-12, 08:23 PM   #6
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
Originally Posted by F16Gaming View Post
Not quite, I'm not sure how to explain it though, so I'll just link the wikipedia article
Most "simplified" explanations for a specific context are of the 'er, not precisely' variety, when speaking to a non-simplified audience. (If you really want to discuss escape mechanics, I can start with ANSI graphics and work our way to the present but somehow I think that would belabor the point )

Originally Posted by Cirbafe View Post
I'm in trouble now include a button inside the window
beside the button and a simple text, how can I do this?
Gosh, I'd love to help but you'd under-post me again so, here's what you do: just imagine I'm posting the simple answer so that it'll come to you and you can post "oh, I figured it out" just before I'd hit the submit button.

Why not find a small mod -- small mods tend to not to need reuse optimization and are easier for novices to read -- that looks like what you're on about and look at the Lua there; or look it up on the Wiki:
http://www.wowpedia.org/API_CreateFrame
http://www.wowpedia.org/Widget_API#Frame
http://www.wowpedia.org/Widget_API#FontString
...etc...

Last edited by VincentSDSH : 09-02-12 at 08:32 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Help CreateFrame()


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