Example #1
0
 def create_text(text):
     format = TextFormat(size=62, font='./resources/papercuts-2.ttf')
     tf = TextField()
     tf.defaultTextFormat = format
     tf.autoSize = TextFieldAutoSize.LEFT
     tf.text = text
     tf.selectable = False
     tf.x = (WIDTH - tf.textWidth) * 0.5
     tf.y = (HEIGHT - tf.textHeight) * 0.5
     return tf
Example #2
0
 def __init__(self):
     super(HelloWorld, self).__init__()
     txt = TextField()
     txt.text = 'Hello World!!!'
     txt.selectable = False
     self.addChild(txt)