Thread Tools Display Modes
07-19-08, 02:35 PM   #1
_Chloe
A Murloc Raider
 
_Chloe's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 8
Frame in XML into Lua

Basically I have this frame I wrote a while ago that imitates the full screen glow/warnings, but modified so I can use my own textures and such, but I'm working on converting it to .lua. Basically this:
Code:
	<Frame name="Tankadin_RF_Warn_Frame" frameStrata="FULLSCREEN_DIALOG" toplevel="true" setAllPoints="true" hidden="true">
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parent_Texture" file="Interface\AddOns\Tankadin\Images\warn1.tga" alphaMode="ADD"/>
			</Layer>
		</Layers>
	</Frame>
- into -

Code:
warnFrame = CreateFrame("Frame", "Tankadin_Warn_Frame");
warnFrame:SetFrameStrata("FULLSCREEN_DIALOG");
warnFrame:SetToplevel(true);
warnFrame:SetAllPoints();
local texture = warnFrame:CreateTexture("Tankadin_Warn_Frame_Texture", "BACKGROUND");
texture:SetTexture("Interface\\AddOns\\Tankadin2\\Images\\warn1");
texture:SetBlendMode("ADD");
But it seems to missing something as when called by the function:
Code:
UIFrameFlash(Tankadin_Warn_Frame, 1, 1, 3.5, false, 1, 0.5);
It doesn't flash. What am I missing? Yes, the image is there and can be called using Tankadin_Warn_Frame_Texture:GetTexture().
  Reply With Quote
07-19-08, 02:52 PM   #2
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
My guess is that
Code:
texture:SetAllPoints()
is missing to position the texture. But I didn't test it ingame
  Reply With Quote
07-19-08, 03:38 PM   #3
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 79
Code:
local warnFrame = CreateFrame("Frame", "Tankadin_Warn_Frame", UIParent)
warnFrame:SetFrameStrata("FULLSCREEN_DIALOG")
warnFrame:SetToplevel(true); -- Not sure if this is needed...
warnFrame:SetAllPoints();-- Not sure if this is needed...
warnFrame:SetPoint"TOPLEFT"
warnFrame:SetPoint"TOPRIGHT"
warnFrame:SetPoint"BOTTOMLEFT"
warnFrame:SetPoint"BOTTOMRIGHT"
local texture = warnFrame:CreateTexture("Tankadin_Warn_Frame_Texture", "BACKGROUND");texture:SetTexture("Interface\\AddOns\\Tankadin2\\Images\\warn1");texture:SetBlendMode("ADD");
Not sure if this will help, but thats how i would do it...

Hope it works though! (UNTESTED!)
  Reply With Quote
07-20-08, 04:48 AM   #4
_Chloe
A Murloc Raider
 
_Chloe's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 8
Originally Posted by Cargor View Post
My guess is that
Code:
texture:SetAllPoints()
is missing to position the texture. But I didn't test it ingame
Thankies. Worked perfect.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Frame in XML into Lua


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