~facundo/enjuewemela/trunk

« back to all changes in this revision

Viewing changes to enjuewemela/cocos/test/test_transition_movein_t.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
 
 
8
 
import cocos
9
 
from cocos.director import director
10
 
from cocos.actions import *
11
 
from cocos.layer import *
12
 
from cocos.scenes import *
13
 
from cocos.sprite import *
14
 
import pyglet
15
 
from pyglet.gl import *
16
 
 
17
 
class BackgroundLayer( cocos.layer.Layer ):
18
 
    def __init__(self):
19
 
        super( BackgroundLayer, self ).__init__()
20
 
        self.img = pyglet.resource.image('background_image.png')
21
 
 
22
 
    def draw( self ):
23
 
        glPushMatrix()
24
 
        self.transform()
25
 
        self.img.blit(0,0)
26
 
        glPopMatrix()
27
 
 
28
 
 
29
 
if __name__ == "__main__":
30
 
    director.init( resizable=True )
31
 
    scene1 = cocos.scene.Scene()
32
 
    scene2 = cocos.scene.Scene()
33
 
 
34
 
    colorl = ColorLayer(32,32,255,255)
35
 
    sprite = Sprite( 'grossini.png', (320,240) )
36
 
    colorl.add( sprite )
37
 
 
38
 
    scene1.add( BackgroundLayer(), z=0 )
39
 
    scene2.add( colorl, z=0 )
40
 
 
41
 
    director.run( MoveInTTransition( scene1, 2, scene2) )