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__), '../../..'))
7
## import all the stuff we need from cocos
9
from cocos.director import director
10
from cocos.sprite import Sprite
11
from cocos import skeleton
13
# import the skeleton we have created
16
class TestLayer(cocos.layer.Layer):
18
super( TestLayer, self ).__init__()
20
x,y = director.get_window_size()
22
# create a ColorSkin for our skeleton
23
self.skin = skeleton.ColorSkin(root_bone.skeleton,
26
# add the skin to the scene
28
x, y = director.get_window_size()
29
self.skin.position = x/2, y/2
32
if __name__ == "__main__":
35
test_layer = TestLayer()
36
bg_layer = cocos.layer.ColorLayer(255,255,255,255)
37
main_scene = cocos.scene.Scene()
38
main_scene.add(bg_layer, z=-10)
39
main_scene.add(test_layer, z=10)
40
director.run(main_scene)