Package interphase :: Module util :: Class Text

Class Text

object --+
         |
        Text

Receives text to display on surface. Arguments include the target surface for text rendering, font_type is a list of alternate font names, and font_size is the font size.
Instance Methods
 
__init__(self, surface, font_type=None, font_size=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__call__(self, surface='default')
Writes text to surface.
 
render(self, surface='default')
Writes text to surface.
 
add(self, *message_append)
Add to text.
 
set_position(self, position, center=False)
Set position to write text.
 
set_text_alignment(self, setting)
Set text alignment. Setting is 'center' or 'left'.
 
set_margin(self, margin)
Set text margin.
 
set_multiline(self, multiline=True)
Set multiline text.
 
set_font(self, font_type, default=False)
Set font of text.
 
get_font(self, font_info='font')
Get current font.
 
get_font_size(self)
Get current font size.
 
set_font_size(self, size)
Set font size of text.
 
set_font_color(self, color)
Set font color of text.
 
set_font_bgcolor(self, color=None)
Set font background color.
 
set_split_text(self, split_text=True)
Set whether text split to new line at space.
 
check_size(self, text)
Get size required for given text.
 
check_sizes(self, texts)
Get size required for a list of texts.
 
surface_size(self, *dim)
Surface size needed to fit text. Return estimated width for col and height for row, adjusted for margins.
 
word_wrap(self, text, width)
Format text lines to fit in surface width, adjusted for margins.
 
split_long_text(self, text, width)
Split long text uninterrupted by spaces to fit in surface width.
 
has_text(self)
Check whether contains text.
 
clear_text(self)
Clear text.
 
tprint(self)
Print text to surface.
 
update(self)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, surface, font_type=None, font_size=None)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)