~facundo/enjuewemela/trunk

« back to all changes in this revision

Viewing changes to enjuewemela/cocos/test/test_fadeouttiles_down.py

  • Committer: facundo at com
  • Date: 2010-11-20 01:42:31 UTC
  • mfrom: (62.1.3 lint-issues)
  • Revision ID: facundo@taniquetil.com.ar-20101120014231-b2tkyc3mwr84ggcc
Project reorder and lint issues

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# This code is so you can run the samples without installing the package
2
 
import sys
3
 
import os
4
 
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
5
 
#
6
 
 
7
 
import pyglet
8
 
import cocos
9
 
from cocos.director import director
10
 
from cocos.actions import *
11
 
from cocos.layer import *
12
 
 
13
 
class BackgroundLayer( cocos.layer.Layer ):
14
 
    def __init__(self):
15
 
        super( BackgroundLayer, self ).__init__()
16
 
        self.img = pyglet.resource.image('background_image.png')
17
 
 
18
 
    def draw( self ):
19
 
        self.img.blit(0,0)
20
 
 
21
 
 
22
 
if __name__ == "__main__":
23
 
    director.init( resizable=True, fullscreen=False )
24
 
    main_scene = cocos.scene.Scene()
25
 
 
26
 
    main_scene.add( BackgroundLayer(), z=0 )
27
 
 
28
 
    e = FadeOutDownTiles( grid=(16,12), duration=2 )
29
 
    main_scene.do( e + Reverse(e) )
30
 
 
31
 
    director.run (main_scene)