MipUU
Początkujacy skrypter lua
Wiek: 25 Na forum: 2659 dni Posty: 20
Nick w MP: Lottus!
Piwa : 316
local screenW , screenH = guiGetScreenSize ()
local czas = getTickCount ()
local rot = 0
local font = dxCreateFont ( "Fonts/font.ttf" , 11 )
function isEventHandlerAdded ( sEventName , pElementAttachedTo , func )
if
type ( sEventName ) == 'string' and
isElement ( pElementAttachedTo ) and
type ( func ) == 'function'
then
local aAttachedFunctions = getEventHandlers ( sEventName , pElementAttachedTo )
if type ( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
for i , v in ipairs ( aAttachedFunctions ) do
if v == func then
return true
end
end
end
end
return false
end
function loadingDownload ()
local Alpha = interpolateBetween ( 0 , 0 , 0 , 255 , 220 , 200 , (( getTickCount () - czas ) / 1000 ), "Linear" )
local r , g , b , a = interpolateBetween ( 0 , 150 , 255 , 255 , 255 , 255 ,( getTickCount ())/ 6500 , "SineCurve" )
local kr1 , kr2 , kr3 = interpolateBetween (- 0.2630 , 0.0368 , 0 , 0.2530 , 0 , 0 , ( getTickCount ())/ 6500 , "SineCurve" )
rot = rot + 5 > 360 and 0 or rot + 5
dxDrawImage ( screenW * 0.0000 , screenH * 0.0000 , screenW * 1.0400 , screenH * 1.0000 , "Img/background.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , Alpha ), false )
dxDrawImage ( screenW * 0.4820 , screenH * 0.7710 , screenW * 0.0195 , screenH * 0.0340 , "Img/loading.png" , rot , 0 , 0 , tocolor ( 255 , 255 , 255 , Alpha ), false )
dxDrawImage ( screenW * - 0.0766 , screenH * kr2 , screenW * 1.1366 , screenH * 1.0768 , "Img/logo.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , Alpha ), false )
dxDrawText ( "Pobieranie zasob?w" , screenW * 0.6909 , screenH * 1.1801 , screenW * 0.2946 , screenH * 0.4596 , tocolor ( r , g , b , Alpha ), 1.00 , font , "center" , "center" , false , false , false , false , false )
end
function loadingObjects ()
local Alpha = interpolateBetween ( 0 , 0 , 0 , 255 , 220 , 200 , (( getTickCount () - czas ) / 1000 ), "Linear" )
local r , g , b , a = interpolateBetween ( 40 , 40 , 40 , 255 , 255 , 255 ,( getTickCount ())/ 6500 , "SineCurve" )
local kr1 , kr2 , kr3 = interpolateBetween (- 0.2630 , 0.0368 , 0 , 0.2530 , 0 , 0 , ( getTickCount ())/ 6500 , "SineCurve" )
rot = rot + 5 > 360 and 0 or rot + 5
dxDrawImage ( screenW * 0.0000 , screenH * 0.0000 , screenW * 1.0400 , screenH * 1.0000 , "Img/background.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , Alpha ), false )
dxDrawImage ( screenW * 0.0230 , screenH * 0.0210 , screenW * 0.0195 , screenH * 0.0340 , "Img/loading.png" , rot , 0 , 0 , tocolor ( 255 , 255 , 255 , Alpha ), false )
dxDrawImage ( screenW * - 0.0766 , screenH * kr2 , screenW * 1.1366 , screenH * 1.0768 , "Img/logo.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , Alpha ), false )
dxDrawText ( "Wczytywanie zasob?w" , screenW * - 0.0709 , screenH * - 0.3801 , screenW * 0.2946 , screenH * 0.4596 , tocolor ( r , g , b , Alpha ), 1.00 , font , "center" , "center" , false , false , false , false , false )
end
function checkingIsDownload ()
if isTransferBoxActive () == true then
addEventHandler ( "onClientRender" , root , loadingDownload )
else
if isEventHandlerAdded ( "onClientRender" , root , loadingDownload ) then
removeEventHandler ( "onClientRender" , root , loadingDownload )
end
end
end
setTimer ( checkingIsDownload , 1000 , 0 )
function checkingIsComingObject ()
if getElementData ( root , "load:objects" ) then
addEventHandler ( "onClientRender" , root , loadingObjects )
else
if isEventHandlerAdded ( "onClientRender" , root , loadingObjects ) then
removeEventHandler ( "onClientRender" , root , loadingObjects )
end
end
end
setTimer ( checkingIsComingObject , 1000 , 0 )
addEventHandler ( "onClientRender" , root , loadingDownload )
[ Dodano : 2019-04-11, 11:34 ]
a tutaj meta jak do czego? sie ma przydac
< meta >
< script src = "c.lua" type = "client" cache = "false" />
< file src = "Img/background.png" />
< file src = "Img/loading.png" />
< file src = "Img/logo.png" />
< file src = "Fonts/font.ttf" />
< export function= "loadingObjects" type = "client" />
< export function= "loadingObjects" type = "server" />
< download_priority_group > 1 </ download_priority_group >
</ meta >
Ostatnio zmieniony przez DsJ3 2019-04-11, 11:37, w całości zmieniany 1 raz