~facundo/enjuewemela/trunk

« back to all changes in this revision

Viewing changes to enjuewemela/cocos/test/test_htmllabel.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.sprite import Sprite
11
 
from cocos.actions import *
12
 
from cocos.text import *
13
 
 
14
 
import pyglet
15
 
 
16
 
class TestLayer(cocos.layer.Layer):
17
 
    def __init__(self):
18
 
        super( TestLayer, self ).__init__()
19
 
        
20
 
        x,y = director.get_window_size()
21
 
        
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 ) )
25
 
        self.add( self.text  )
26
 
        
27
 
        
28
 
 
29
 
if __name__ == "__main__":
30
 
    director.init()
31
 
    test_layer = TestLayer ()
32
 
    main_scene = cocos.scene.Scene (test_layer)
33
 
    director.run (main_scene)