View Single Post
06-13-09, 06:19 PM   #12
Recluse
A Cliff Giant
 
Recluse's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 70
Showing a black square in center of screen:

TestFrame.toc
Code:
## Interface: 30100
## Title: TestFrame
## Author: Recluse

TestFrame.lua
TestFrame.lua
Code:
local f = CreateFrame("Frame", "TestFrame", UIParent)
f:SetFrameStrata("BACKGROUND")
f:SetWidth(100)
f:SetHeight(100)
f:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
f.texture = f:CreateTexture(nil, "BACKGROUND")
f.texture:SetAllPoints(f)
f.texture:SetTexture(0, 0, 0, 1)
You can just set the texture to an rgba value like this instead of a file.

Also, you said you wanted to pin your texture to the top of the screen, so you'll want to change it to f:SetPoint("TOP", UIParent, "TOP", 0, 0) I think. (yeah, I use the long version of SetPoint =x)

If this works, then make sure your image follows the correct rules maybe?
http://www.wowwiki.com/API_Texture_SetTexture

Originally Posted by Waverian View Post
The relative frame doesn't need to be passed to SetAllPoints if you want it to be relative to the parent.
Interesting, I had no idea
__________________
We'd be together, but only diamonds last forever...

Last edited by Recluse : 06-13-09 at 06:22 PM.
  Reply With Quote