Permalink
Browse files

Modified 'module' template to create a generic module.

  • Loading branch information...
1 parent cf8d21c commit 70006ac76f9fd903e37c1775316d0b471b7e3625 @osadchuk committed Mar 30, 2012
Showing with 2 additions and 92 deletions.
  1. +2 −92 Templates/untitled.tmTemplate/template_in.txt
@@ -1,95 +1,5 @@
-----------------------------------------------------------------------------------
---
--- scenetemplate.lua
---
-----------------------------------------------------------------------------------
+local Module = {}
-local storyboard = require( "storyboard" )
-local scene = storyboard.newScene()
-----------------------------------------------------------------------------------
---
--- NOTE:
---
--- Code outside of listener functions (below) will only be executed once,
--- unless storyboard.removeScene() is called.
---
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
--- BEGINNING OF YOUR IMPLEMENTATION
----------------------------------------------------------------------------------
-
--- Called when the scene's view does not exist:
-function scene:createScene( event )
-local group = self.view
-
------------------------------------------------------------------------------
-
--- CREATE display objects and add them to 'group' here.
--- Example use-case: Restore 'group' from previously saved state.
-
------------------------------------------------------------------------------
-
-end
-
-
--- Called immediately after scene has moved onscreen:
-function scene:enterScene( event )
-local group = self.view
-
------------------------------------------------------------------------------
-
--- INSERT code here (e.g. start timers, load audio, start listeners, etc.)
-
------------------------------------------------------------------------------
-
-end
-
-
--- Called when scene is about to move offscreen:
-function scene:exitScene( event )
-local group = self.view
-
------------------------------------------------------------------------------
-
--- INSERT code here (e.g. stop timers, remove listeners, unload sounds, etc.)
-
------------------------------------------------------------------------------
-
-end
-
-
--- Called prior to the removal of scene's "view" (display group)
-function scene:destroyScene( event )
-local group = self.view
-
------------------------------------------------------------------------------
-
--- INSERT code here (e.g. remove listeners, widgets, save state, etc.)
-
------------------------------------------------------------------------------
-
-end
-
----------------------------------------------------------------------------------
--- END OF YOUR IMPLEMENTATION
----------------------------------------------------------------------------------
-
--- "createScene" event is dispatched if scene's view does not exist
-scene:addEventListener( "createScene", scene )
-
--- "enterScene" event is dispatched whenever scene transition has finished
-scene:addEventListener( "enterScene", scene )
-
--- "exitScene" event is dispatched before next scene's transition begins
-scene:addEventListener( "exitScene", scene )
-
--- "destroyScene" event is dispatched before view is unloaded, which can be
--- automatically unloaded in low memory situations, or explicitly via a call to
--- storyboard.purgeScene() or storyboard.removeScene().
-scene:addEventListener( "destroyScene", scene )
-
----------------------------------------------------------------------------------
-
-return scene
+return Module

0 comments on commit 70006ac

Please sign in to comment.