Tematy otagowane jako: alphy
1. Animacja alphy
Witam mam tutaj taki kod ale co? nie dzia?a prosi?bym o pomoc.
Kod:
addEventHandler ( "onClientMarkerHit" , getRootElement (),
function( plr )
if source == rozpocznij then else return end
if getElementType ( plr ) == "player" then else return end
if isElementWithinMarker ( plr , rozpocznij ) then else return end
pojazd = getPedOccupiedVehicle ( plr )
if pojazd then return end
local now = getTickCount ()
local endTime = start + 10000
local elapsedTime = now - start
local duration = endTime - start
local progress = elapsedTime / duration
a1 = interpolateBetween ( 0 , 0 , 0 , 255 , 0 , 0 , progress , "Linear" )
guiSetAlpha ( window1 , a1 )
2. Płynna zmiana wartości alphy
Posiadam taki kod, kt?ry po najechaniu na dxDrawRectangle musi p?ynnie zmieni? warto?? alphy z 100 na 200. Gdy naje?d?am interpolateBetween wcale si? nie wykonuje, po prostu jakbym ustawi? po najechaniu alpha 200, a po za obszarem rectangle 100.
Co mam poprawi??
if isMouseIn ( 50 , 100 , 50 , 100 ) then
startTick = getTickCount ()
alpha = interpolateBetween ( 100 , 0 , 0 , 200 , 0 , 0 , ( getTickCount ()- startTick )/ 1000 , "Linear" )
else
startTick = getTickCount ()
alpha = interpolateBetween ( 200 , 0 , 0 , 100 , 0 , 0 , ( getTickCount ()- startTick )/ 1000 , "Linear" )
end
dxDrawRectangle ( 50 , 100 , 50 , 100 , tocolor ( 255 , 255 , 255 , alpha ), false )