function guidxCreateWindow(x,y,w,h,text)
local win = guiCreateStaticImage( x,y,w,h, "black.png", false)
local wx, wy = guiGetSize ( win, false )
guiSetProperty( win, "Alpha", 70)
local winup = guiCreateStaticImage( 0,0,1,0.1, "winup.jpg", true, win )
local text = guiCreateLabel(0,0,1, 1,text,true, winup)
guiSetProperty( text, "Alpha", 300)
guiLabelSetHorizontalAlign(text, "center")
guiLabelSetVerticalAlign(text, "center")
guiSetFont ( text, guiCreateFont( "font.ttf", 30 ) )
return win
end
--------------------------------------------------TEST-------------------------------------------
local sx,sy = guiGetScreenSize ( )
local dxgui = guidxCreateWindow( sx*0.5, sy*0.5, sx*0.6, sy*0.6,"TEST PANEL")
guiSetVisible ( dxgui, false )
function move ( )
local x, y = guiGetPosition ( dxgui, false )
local w, h = guiGetSize ( dxgui, false )
local now = getTickCount()
local elapsedTime = now - start
local endtime = start + 1000
local duration = endtime - start
local progress = elapsedTime / duration
local w1, h1, z = interpolateBetween ( 0, 0, 0, w, h, 0, progress, "Linear")
local x1 = x-(w1/2)
local y1 = y-(h1/2)
guiSetPosition ( dxgui, x1, y1, false)
guiSetSize ( dxgui, w1, h1, false)
end
function test ( )
if ( guiGetVisible ( dxgui ) == false ) then
guiSetVisible ( dxgui, true )
start = getTickCount()
addEventHandler ("onClientRender", root, move)
else
guiSetVisible ( dxgui, false )
removeEventHandler ("onClientRender", root, move)
end
end
bindKey ("F2","down", test)