Token.TextToken

TextToken

class miniworldmaker.tokens.text_token.TextToken(*args, **kwargs)[source]

A Text-Token is a token which contains a Text.

You have to set the size of the token with self.size() manually so that the complete text can be seen.

Parameters
  • position – Top-Left position of Text

  • text – The initial text

  • font-size – The size of the font (default: 80)

  • color – The color of the font (default: white)

Examples

>>> self.text = TextToken((1,1), "Hello World")
Creates a new text_token
get_text()[source]

Gets the currently displayed tex

Returns: The currently displayed text

set_text(text)[source]

Sets the text of the token

Parameters

text – The text