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
def __init__(self): super(HelloWorld, self).__init__() txt = TextField() txt.text = 'Hello World!!!' txt.selectable = False self.addChild(txt)