GLBasic forum

Feature request => 2D => Topic started by: FutureCow on 2009-Oct-29

Title: Blendscreen speed
Post by: FutureCow on 2009-Oct-29
How about a parameter for BLENDSCREEN for setting the speed in which it blends from one image to the other?
Title: Re: Blendscreen speed
Post by: Kitty Hello on 2009-Oct-29
ok, I'll add that.
Title: Re: Blendscreen speed
Post by: bigsofty on 2009-Oct-29
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 ;)