Package populusgui :: Module PopulusGui :: Class ChatBalloon
[frames] | no frames]

Class ChatBalloon


Class for creating Chat-balloon Create a balloon to show up what the agent said.

Instance Methods
 
__init__(self, parent=render, pos=(0, 0.2, 0), scale=0.2, showTime=0.5)
Constructor for ChatBalloon.
 
setColor(self, color)
Set the color of the ChatBalloon.
 
setText(self, text, stop=None)
Show a text message inside the balloon and let it fade out.

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

Class Variables
string DEFAULT_TEXT = 'balloonText'
The default text to display in the ChatBalloon.
string DEFAULT_FONT = 'Models/font/comic.egg'
The default font to use in the ChatBalloon.
string DEFAULT_MODEL = 'Models/balloon.egg'
The relative path to the model of the ChatBalloon.
tuple DEFAULT_TEXT_COLOR = (0, 0, 0, 1)
The default color of the text.
int WORDWRAP = 10
Maximum length of a text string before it's wrapped to a new line.
string NODE_NAME = 'ChatBalloon'
The name of the ChatBalloon NodePath.
string DUMMY_NODE_NAME = 'dummy'
The name of the dummy NodePath.
tuple or Point3 FRAME_POSITION = (0, 0.35, -1e-005)
The position of the ChatBallon frame relative to the dummy.
Properties

Inherited from object: __class__

Method Details

__init__(self, parent=render, pos=(0, 0.2, 0), scale=0.2, showTime=0.5)
(Constructor)

 

Constructor for ChatBalloon.

Parameters:
  • parent (object) - The owner/parent of the ChatBalloon. Default render.
  • pos (tuple or Point3) - The relative position of the ChatBalloon.
  • scale (float) - The Scaled size of the ChatBalloon.
  • showTime (float) - The time it takes for a ChatBalloon to fade away.
Overrides: object.__init__

setColor(self, color)

 

Set the color of the ChatBalloon.

Parameters:
  • color (tuple) - The color to set as a tuple of 4. (R,G,B,Alpha)

setText(self, text, stop=None)

 

Show a text message inside the balloon and let it fade out.

Parameters:
  • text (string) - Text to be displayed in the ChatBalloon.
  • stop (Boolean) - Switch controlling automatic timeouts. (Default: None).

Class Variable Details

DEFAULT_FONT

The default font to use in the ChatBalloon. The relative path tothe font .egg file.
Type:
string
Value:
'Models/font/comic.egg'

DEFAULT_TEXT_COLOR

The default color of the text. Format : (R,G,B,Alpha).
Type:
tuple
Value:
(0, 0, 0, 1)