Advertisement
Guest User

Explode.lua

a guest
Mar 3rd, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. return function(page, offset, swidth, sheight)
  2.   local percent = offset/page.width
  3.   page.layer.x = page.layer.x + offset
  4.   if percent > 0 then
  5.     mult = 4
  6.   else
  7.     mult = 1
  8.   end
  9.   for i, icon in subviews(page) do
  10.     local distx = icon.x+(icon.width/2)-(page.width/2)
  11.     local disty = icon.y+(icon.height/2)-(page.height/2)
  12.     icon:translate(mult*distx*percent, mult*disty*percent, 0)
  13.   end
  14.   if percent < 0 then
  15.     page.alpha = 1 - math.abs(percent)/0.85
  16.   end
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement