View Single Post
06-13-09, 05:07 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,953
Hmm strange Ive never had that happen to me .. but let me see .. do you use xml with lua or just pure lua ?

Here's what I do in pure lua code. It is pretty basic but putting this into the lua file it should create a small window with a slightly transparent background. Hopefully that will help you.

Code:
local MyFrame;

function OnMouseDown(frame)
        if (( ( not frame.isLocked ) or ( frame.isLocked == 0 ) )) then
                frame:StartMoving();
                frame.isMoving = true;
        end
end

function OnMouseUp(frame)
        if ( frame.isMoving ) then
                frame:StopMovingOrSizing();
                frame.isMoving = false;
        end
end

function OnHide(frame)
        if ( frame.isMoving ) then
                frame:StopMovingOrSizing();
                frame.isMoving = false;
        end
end

function CreateMyFrame()
    -- Create the Frame
    MyFrame = CreateFrame("Frame","MyFrame",UIParent);
    -- Make Frame Movable and attach functionality
    MyFrame:RegisterForDrag("LEFTBUTTON");
    MyFrame:EnableMouse(true);
    MyFrame:SetMovable(true);
    MyFrame:SetScript("OnMouseDown",OnMouseDown);
    MyFrame:SetScript("OnMouseUp",OnMouseUp);
    MyFrame:SetScript("OnHide",OnHide);
    -- Set Strata Level and Size
    MyFrame:SetFrameStrata("BACKGROUND");
    MyFrame:SetWidth(300); -- Set these to whatever height/width is needed 
    MyFrame:SetHeight(200); -- for your Texture  
    -- Clamp to screen and center it with no opacity        
    MyFrame:SetClampedToScreen(true);
    MyFrame:SetPoint("CENTER",0,0);
    MyFrame:SetAlpha(1.0);
    -- Set the Backdrop
    MyFrame:SetBackdrop( 
    { 
         bgFile = "Interface/Tooltips/UI-Tooltip-Background", 
         edgeFile = "Interface/Tooltips/UI-Tooltip-Border", 
         tile = true, 
         tileSize = 16, 
         edgeSize = 16, 
         insets = { left = 4, right = 4, top = 4, bottom = 4 }
     }
     );
     MyFrame:SetBackdropColor(0,0,0,1);
     MyFrame:SetBackdropBorderColor(255,255,0,1);
    
end


CreateMyFrame();
MyFrame:Hide() -- To Hide the Frame
Or
MyFrame:Show() -- To Show the Frame
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 06-13-09 at 05:20 PM.
  Reply With Quote