Permalink
Browse files

Popups will now be updated like regular scenes.

  • Loading branch information...
1 parent 29053bd commit 2ad15033962416b43fdf3a208f87d4d958453fd1 @GrahamRanson GrahamRanson committed Nov 29, 2012
Showing with 13 additions and 8 deletions.
  1. +11 −6 GGScene.lua
  2. +2 −2 PopupC.lua
View
@@ -93,7 +93,7 @@ function GGScene:new( defaultTime, defaultEasing )
self.view = display.newGroup()
- -- Runtime:addEventListener( "enterFrame", self )
+ Runtime:addEventListener( "enterFrame", self )
return self
@@ -1097,11 +1097,16 @@ function GGScene:displayInformation( message )
end
--- Updates the current scene.
---function GGScene:enterFrame( event )
--- if self.currentScene and self.currentScene.isReady and self.currentScene[ "onUpdate" ] then
--- self.currentScene:onUpdate( event )
--- end
---end
+function GGScene:enterFrame( event )
+ if self.currentScene and self.currentScene.isReady and self.currentScene[ "onUpdate" ] then
+ self.currentScene:onUpdate( event )
+ end
+ for k, v in pairs( self.popups ) do
+ if v and v.isReady and v[ "onUpdate" ] then
+ v:onUpdate( event )
+ end
+ end
+end
--- Destroys this GGScene object.
function GGScene:destroy()
View
@@ -54,9 +54,9 @@ function PopupC:onCreate( data )
end
--- Called in the enterFrame event.
---function PopupC:onUpdate( event )
+function PopupC:onUpdate( event )
---end
+end
--- Called when the scene is about to get loaded.
function PopupC:onLoad()

0 comments on commit 2ad1503

Please sign in to comment.