Blendscreen speed

Previous topic - Next topic

FutureCow

How about a parameter for BLENDSCREEN for setting the speed in which it blends from one image to the other?

Kitty Hello

ok, I'll add that.

bigsofty

#2
Quick fix, should work on iPhone in landscape too...?

Code (glbasic) Select
// --------------------------------- //
// Project: ImageSwap
// Start: Thursday, October 29, 2009
// IDE Version: 7.149


LOADSPRITE "me.jpg", 0
LOADSPRITE "avatar_2.jpg", 1
ts = GETTIMERALL()
tt = 10 // 10 sec swap
WHILE 1
imageMerge((((ts+(tt*1000))-GETTIMERALL())/1000)/tt , 0, 1, 100, 100)
SHOWSCREEN
WEND
END



// ------------------------------------------------------------- //
// ---  IMAGEMERGE  // % of swap (0..1) ---
// ------------------------------------------------------------- //
FUNCTION imageMerge: amount, image0, image1, x, y
IF amount < 0 OR amount > 1 THEN amount = 0.000000001 // GLB not like 0 alpha?
ALPHAMODE 1-amount
DRAWSPRITE image0, x, y
ALPHAMODE amount
DRAWSPRITE image1, x, y
ENDFUNCTION // IMAGEMERGE


P.S. I use something like CREATESCREEN to merge complete screens with the above ;)
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)