tick = getTickCount()
function drawStart()
animation = true
local interpolation = interpolateBetween(-400,0,0,0,0,0,(getTickCount()-tick)/3000,'OutQuad')
dxDrawImage(x + interpolation , y, w, h, photo)
setTimer(function()
animation = false
end, 3000, 1)
end
function images()
if animation then return end
if isMouseIn(x, y, w, h) then
dxDrawImage(x , y, w, h, photo)
end
end
Masz przyk?ad, tylko ustaw sobie czas timer'a
Po co kombinowa? w dodatku i tak by to nie dzia?a?o jakby mia? funkcje drawStart w onClientRender
Nie wypowiadaj si? jak nie podo?asz postowi, po co?
local sx, sy = guiGetScreenSize()
local tick = getTickCount()
isMouseIn = function(psx, psy, pssx, pssy, abx, aby)
if not isCursorShowing() then return end
cx, cy = getCursorPosition()
cx, cy = cx * sx, cy * sy
if cx >= psx and cx <= psx + pssx and cy >= psy and cy <= psy + pssy then
return true, cx, cy
else
return false
end
end
function drawStart()
local interpolation = interpolateBetween(-400,0,0,0,0,0,(getTickCount()-tick)/3000,'OutQuad')
dxDrawRectangle(554, 189 + interpolation, 275, 80, tocolor(255, 255, 255, 255), false)
setTimer(function()
animation = false
end, 3000, 1)
if not animation then
if isMouseIn(554, 189, 275, 80) then
dxDrawRectangle(554, 189 + interpolation, 275, 80, tocolor(0, 0, 0, 255), false)
end
end
end
function start()
addEventHandler('onClientRender', root, drawStart)
animation = true
tick = getTickCount()
end
addEventHandler('onClientResourceStart', resourceRoot, start)
Prosty przyk?ad zrobi?em z dxDrawRectangle, dop?ki animacja nie doleci, nie pojawi si?, gdy doleci - dopiero wtedy dzia?a if isMouseIn.
Je?li chcesz na przyk?ad by wykonywa?o to gdy wejdziesz w marker, to przy wchodzeniu dajesz
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach