Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-06-11, 09:10 AM   #1
frohanss
A Cyclonian
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 40
Few Question's regarding creating frames.

Hello,

i have been working on a small addon to make UI panels. Instead of using kgpanels and other simular addons.
Mostly to learn how to write addon's myself.

So here is some question's i have:

Default code im using on frames:
Code:
function CreateLBottom() --Left Bottombar/Infotab

    LBottom = CreateFrame("Frame","LBottom",UIParent);
    LBottom:SetFrameStrata("BACKGROUND");
    LBottom:SetWidth(CPwidth); 
    LBottom:SetHeight(CPbarsheight); 
    LBottom:SetClampedToScreen(true);
	LBottom:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 2, 2)
    LBottom:SetAlpha(1.0);
    LBottom:SetBackdrop(BACKD);
     LBottom:SetBackdropColor(Backdropcolors);
     LBottom:SetBackdropBorderColor(1,1,1,1);
    
end
Im using the following default values:
Code:
local BACKD =     { 
         bgFile = "Interface\\FrameGeneral\\UI-Background-Marble", 
         edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", 
         tile = false, 
         tileSize = 16, 
         edgeSize = edgeS, 
         insets = inseT
     }
local CPwidth = 300
local CPbarsheight = 20
local edgeS = 8
local inseT = { left = 0, right = 0, top = 0, bottom = 0 }
Question 1: Can i make a new frame by using the above frame as template and just change the hight of the next frame? How?

Question 2: How can i make a frame to only show if a addon is loaded? And i don't mean just parent the frame to that addon.

Question 3: How can i make a slash comman to toggle 1 of the panels?

Trouble 1: When i try to add a default value for border color it doesn't use the right color. Most of the time the border becomes red.
Here is how im trying todo it.
Code:
local BColor_r = 0.5,0.5,0.5,1

LBottom:SetBackdropBorderColor(BColor_r);
And i can't seem to get this to work:
Code:
local BColor_r = RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b
Question 4: Is there any command/math formula to calculate how big the edgsize should be? Cause it seem's to be a conection between width and hight of panels. If i just use same edgsize on small frames and big frames the border becomes blury.
I have my UI scale set by: /run SetCVar("uiScale", 768/string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)"))

Last Question: How can i make a panel width to be 99% of the screen? To use as a top panel.

Many questions i know Im just starting to learn this LUA stuff.

Thx in advance for replys.

Last edited by frohanss : 03-06-11 at 09:18 AM.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Few Question's regarding creating frames.


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