Log In  


Could someone make cart that shows some basic transition effects (crossfade, swipe left/up/down, fade to black, etc) for those who want to have those but don't have skills to code it?

P#14157 2015-09-14 20:59 ( Edited 2015-09-15 06:56)


crossfade is going to be pretty tricky, because you'll have to store the whole screen in lua variables and have blends between all 16 colors (16x16xblend_levels array, plus 1920 variables minimum for screen data). I did fade to black and white like this:

_pi=0-- -100=>100, remaps spal
_pe=0-- end pi val of pal fade
_pf=0-- frames of fade left
function fade(from,to,f)
    _pi=from _pe=to _pf=f

and in _update at the bottom:

if(_pf>0) then --pal fade
    if(_pf==1) then _pi=_pe
    else _pi+=((_pe-_pi)/_pf) end

and in _draw at the bottom:

local pix=6+flr(_pi/20+0.5)
if(pix!=6) then
    for x=0,15 do
else pal() end

Then you just call fade(0,-100,8); (to fade from default colors to solid black in 8 frames), and transition when _pf==1

Swipe (which I think means the wipe effect where it moves to an edge?) would probably use memcpy on the screen memory with a big for loop. I think you can do it, but there might be lag on that.

P#14178 2015-09-15 05:41 ( Edited 2015-09-15 05:56)


About fades, I've rather thought about "dithered" version:

P#14182 2015-09-15 06:56 ( Edited 2015-09-15 06:58)

Log in to post a comment


New User | Account Help
:: New User
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2018-08-19 15:16 | 0.168s | 1572k | Q:11