How do you fade a picture in and out using drawsprite? I tried using blendscreen but is there another way of doing it?
// fade out. If perc
FUNCTION FadeOut:
LOCAL t1, t2
t2 = GETTIMERALL() + 500 // 500 ms duration
t1 = GETTIMERALL()
WHILE TRUE
LOCAL pos = (GETTIMERALL() - t1) / (t2-t1)
IF pos>=1.0
ALPHAMODE 0
BLACKSCREEN
BREAK
ENDIF
ALPHAMODE -MAX(0.01, pos)
DRAWRECT 0,0,screenwidth, screenheight, 0
SHOWSCREEN
WEND
ENDFUNCTION
// fade out. If perc
FUNCTION FadeIn: img$
LOCAL t1, t2
LOCAL id% = GENSPRITE()
LOADSPRITE img$, id%
t2 = GETTIMERALL() + 500 // 500 ms duration
t1 = GETTIMERALL()
WHILE TRUE
LOCAL pos = (GETTIMERALL() - t1) / (t2-t1)
IF pos>=1.0
ALPHAMODE 0
LOADSPRITE "", id%
LOADBMP img$
BREAK
ENDIF
ALPHAMODE -MAX(0.01, pos)
DRAWSPRITE id%, 0,0
SHOWSCREEN
WEND
ENDFUNCTION
Thanks Gernot :)
Nice....thanks. :good: