ÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÀ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌÀ¬ÀÀÀ¬ÀÀÀ¬ÀÀÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÌ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌ̬ÀÀÀ¬ÀÀÀ¬ÀÀ¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî >÷ ª     ª ª   ªª ª ª      ª ªªª       ª ªª ª  ª ª ªª  ªª ª     ª ª ªª       ª ª         ª      ªª   ª  ªªªª ªª ª  ª          ª ªª         ª      ªª  ª  ª    ª ª   ª ª ªªªª ª  ª ª ªª    ª ªª  ª ªª      ª ª ª ª “-- title: Text Coagulate -- author: PaulR(Mr Happy/paul59) -- desc: Text coagulation effect -- license: MIT License -- version: 1.0 -- script: lua local rnd=math.random local INTI,COAG,DONE=1,2,3 local EASING=0.05 local msg="Coagulation Text Effect" local state=INIT local tx,ty --text position local w,h --dimensions of text local dest={} --destination coords local points={} --pixels local arrived function init() --print message offscreen to get width w=print(msg,0,-6) h=6 --calculate centred text position tx=(240-w)//2 ty=(136-6)//2 --palette colors 0,1 are set to black --print message in 'invisible' color --grab color 1 pixel coords into --destination table print(msg,tx,ty,1) for x=0,w do for y=0,h do --if color 1 store coords if pix(tx+x, ty+y)==1 then dest[#dest+1]={tx+x, ty+y} end end end arrived=0 --set start points offscreen for i=1,#dest do local rx,ry if rnd()>0.5 then rx=240+rnd(1000) else rx=-rnd(1000) end if rnd()>0.5 then ry=136+rnd(1000) else ry=-rnd(1000) end points[i]={rx,ry,false} end state=COAG end --ease pixels towards destination --positions, keep count of arrivals function update() --if all arrived... if arrived==#dest then state=DONE return end --for each pixel for i=1,#points do --if not arrived if points[i][3]==false then --get distance to destination local distx=dest[i][1]-points[i][1] local disty=dest[i][2]-points[i][2] --ease towards destination points[i][1]=points[i][1]+distx*EASING points[i][2]=points[i][2]+disty*EASING --set integer coords and --mark as true if arrived if math.abs(points[i][1]-dest[i][1])<1 then if math.abs(points[i][2]-dest[i][2])<1 then points[i][1]=dest[i][1] points[i][2]=dest[i][2] points[i][3]=true arrived=arrived+1 end end end end end function TIC() if state==INIT then init() elseif state==COAG then cls(0) --move pixels update() --draw pixels for i=1,#points do pix(points[i][1],points[i][2],9) end else cls(0) --draw pixels for i=1,#points do pix(points[i][1],points[i][2],10) end end end