1
# This code is so you can run the samples without installing the package
4
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
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 *
15
from pyglet.gl import *
17
class BackgroundLayer( cocos.layer.Layer ):
19
super( BackgroundLayer, self ).__init__()
20
self.img = pyglet.resource.image('background_image.png')
22
self.anchor = (320,240)
31
if __name__ == "__main__":
32
director.init( resizable=True )
33
scene = cocos.scene.Scene()
35
l = cocos.layer.Layer()
36
s = Sprite('grossini.png', (0,0) )
39
scene.add( BackgroundLayer(), z=0 )