Log In Pico-8 transition effects cart? darkhog 3  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 10:56) 2 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:

 ```_shex={["0"]=0,["1"]=1, ["2"]=2,["3"]=3,["4"]=4,["5"]=5, ["6"]=6,["7"]=7,["8"]=8,["9"]=9, ["a"]=10,["b"]=11,["c"]=12, ["d"]=13,["e"]=14,["f"]=15} _pl={="00000015d67", ="0000015d677", ="0000024ef77", ="000013b7777", ="0000249a777", ="000015d6777", ="0015d677777", ="015d6777777", ="000028ef777", ="000249a7777", ="00249a77777", ="00013b77777", ="00013c77777", ="00015d67777", ="00024ef7777", ="0024ef77777"} _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 end ```

and in _update at the bottom:

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

and in _draw at the bottom:

 ```local pix=6+flr(_pi/20+0.5) if(pix!=6) then for x=0,15 do pal(x,_shex[sub(_pl[x],pix,pix)],1) end 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 09:56)   