~facundo/enjuewemela/trunk

« back to all changes in this revision

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

  • Committer: facundo at com
  • Date: 2011-05-14 18:13:25 UTC
  • mfrom: (67.1.4 v3rel)
  • Revision ID: facundo@taniquetil.com.ar-20110514181325-614h8kjz32w5cmoy
Refactor back

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
if __name__ == "__main__":
 
22
    director.init( resizable=True )
 
23
    main_scene = cocos.scene.Scene()
 
24
 
 
25
    main_scene.add( BackgroundLayer(), z=0 )
 
26
 
 
27
    e = SkewHorizontal( duration=1 )
 
28
    main_scene.do( e )
 
29
 
 
30
    director.run( main_scene )