Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Storyboard extra

By: lvs on Jan 22nd, 2014  |  syntax: Lua  |  size: 1.05 KB  |  views: 78  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function storyboard.goBack()
  2.     local prev = storyboard.prevName
  3.     if prev then
  4.         storyboard.gotoScene(prev, {effect = 'slideRight', time = 400, params = storyboard.prevParams, back = true})
  5.         return true
  6.     else
  7.         return false
  8.     end
  9. end
  10.  
  11. storyboard._gotoScene = storyboard.gotoScene
  12. function storyboard.gotoScene(name, params)
  13.     if not params then
  14.         storyboard.prevName = storyboard.getCurrentSceneName()
  15.         storyboard.prevParams = storyboard.currentParams
  16.         storyboard.currentParams = nil
  17.         storyboard._gotoScene(name)
  18.     elseif params then
  19.         storyboard.prevName = storyboard.getCurrentSceneName()
  20.         storyboard.prevParams = storyboard.currentParams
  21.         if params.back then
  22.             storyboard.prevName = nil
  23.             storyboard.prevParams = nil
  24.         end
  25.         storyboard.currentParams = params.params
  26.         storyboard._gotoScene(name, params)
  27.     end
  28. end
  29.  
  30. function storyboard.getCurrentScene()
  31.     return storyboard.getScene(storyboard.getCurrentSceneName())
  32. end