示例#1
0
 def on_start(self):
     "Create a blackout sprite and start it fading out"
     PigDirector.scene.add_layer("overlay")
     sprite = Sprite()
     sprite.set_layer("overlay")
     sprite.image_file = "art/block.png"
     size = Opioid2D.Display.get_view_size()
     sprite.scale = (size[0] / 2, size[1] / 2)
     sprite.tint = (0, 0, 0)
     sprite.position = sprite.scale
     sprite.do( AlphaFade(0,self.blackout_secs) + \
                CallFunc(PigDirector.scene.delete_layer, "overlay")
                )
示例#2
0
 def on_start(self):
     "Create a blackout sprite and start it fading out"
     PigDirector.scene.add_layer("overlay")
     sprite = Sprite()
     sprite.set_layer("overlay")
     sprite.image_file = "art/block.png"
     size = Opioid2D.Display.get_view_size()
     sprite.scale = (size[0]/2,size[1]/2)
     sprite.tint = (0,0,0)
     sprite.position = sprite.scale
     sprite.do( AlphaFade(0,self.blackout_secs) + \
                CallFunc(PigDirector.scene.delete_layer, "overlay")
                )
示例#3
0
 def on_switch_scene(self, scene):
     "Create a blackout sprite and start it fading in"
     PigDirector.scene.add_layer("overlay")
     sprite = Sprite()
     sprite.set_layer("overlay")
     sprite.image_file = "art/block.png"
     size = Opioid2D.Display.get_view_size()
     sprite.scale = (size[0]/2,size[1]/2)
     sprite.tint = (0,0,0)
     sprite.alpha = 0
     sprite.position = sprite.scale
     PigDirector.scene.block_switch_scene( sprite)
     sprite.do( AlphaFade(1,self.blackout_secs) + \
                CallFunc(PigDirector.scene.block_switch_scene, sprite, False)
                )
示例#4
0
 def on_switch_scene(self, scene):
     "Create a blackout sprite and start it fading in"
     PigDirector.scene.add_layer("overlay")
     sprite = Sprite()
     sprite.set_layer("overlay")
     sprite.image_file = "art/block.png"
     size = Opioid2D.Display.get_view_size()
     sprite.scale = (size[0] / 2, size[1] / 2)
     sprite.tint = (0, 0, 0)
     sprite.alpha = 0
     sprite.position = sprite.scale
     PigDirector.scene.block_switch_scene(sprite)
     sprite.do( AlphaFade(1,self.blackout_secs) + \
                CallFunc(PigDirector.scene.block_switch_scene, sprite, False)
                )