Just thought we should have one of these for any one to use

any functions go!!


this is one to make the screen fade from the middle out
Code:
--All credit for function to ST@TIC
--plz email if you use it or credit me!  
--paulmsamuels@hotmail.com
function screen:fadeFmid(a,b,c) --RGB values
  red= Color.new(255,255,255)
  for k=240,480 do
    a = a- 1
    b =b- 1
    c = c- 1
   screen:drawLine(k,0,k,272,Color.new(a,b,c))
   screen:drawLine(480-k,0,480-k,272,Color.new(a,b,c))
  end
end
heres another one to fade from the top down
Code:
--All credit for function to ST@TIC
--plz email if you use it or credit me!  
--paulmsamuels@hotmail.com
function screen:fade(aorig,borig,corig)--RGB values
local a = aorig
local  b = borig
local  c = corig
for k=0,272 do
 a = a-1
 b = b-1
 c = c-1
 screen:drawLine(0,k,480,k,Color.new(a,b,c))
end
end
heres one to keep ur character in the screen
Code:
--All credit for function to ST@TIC
--plz email if you use it or credit me!  
--paulmsamuels@hotmail.com
function stayinScr(px,py,ph,pw)
local tempx = false
local tempy = false
if px + pw > 480 then 
 px = 480 - pw 
 tempx = true
end
if px < 0 then
 px = 0 
tempx = true 
end
if py < 0 then 
 py = 0
 tempy = true
 end
if py + ph > 272 then
 py = 272 - ph
 tempy = true
 end
if tempy == true then
return py
end
if tempx then
return px
end
end
HAVE FUN OR DIE! :twisted: