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.sprite import Sprite
11
from cocos.actions import *
12
from cocos.text import *
16
class TestLayer(cocos.layer.Layer):
18
super( TestLayer, self ).__init__()
20
x,y = director.get_window_size()
22
self.text = HTMLLabel("<font color=red>hello <i>world</i></font>", (x/2, y/2))
23
self.text.do( Rotate( 360, 10 ) )
24
self.text.do( ScaleTo( 10, 10 ) )
29
if __name__ == "__main__":
31
test_layer = TestLayer ()
32
main_scene = cocos.scene.Scene (test_layer)
33
director.run (main_scene)