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
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