Class bzDisplay
source code
This object is a facility to display message in a multiline form. It
is typically used to split long text strings into several lines of
text.
Exemple:
# initialisation
aDisplay = bzDisplay()
aDisplay.QueueMessage ('Hi there ..','JiBe')
aDisplay.QueueMessage ('Hi Jibe, nice to see you in here. How are you ?','LOD')
aDisplay.QueueMessage ('I'm fine, thank you .. what about you ?','JiBe')
# display
print aDisplay.GetDisplay (nb_lines = 8, nb_car= 28)
will give the following result:
JiBe: Hi there ..
LOD: Hi Jibe, nice to see you in
here. How are you ?
JiBe: I'm fine, thank you ..
what about you ?
|
list of [string, string].
|
messages
list of message [pseudo, text].
|
Append a message to the list of message to be displayed. This fonction
is typically called when a new incoming message has been received
- Parameters:
pseudo (String.) - The pseudo of the player who sent the message.
message (String) - The message itself.
|
|
Compute a list of character string showing received messages
Messages are cesurated so that lines never end in the mid of a word.
Messages are formatted so that each received messages starts at the
beginning of a line. If messages are too numerous to be displayed on
nb_lines lines, only the last nb_lines lines are processed.
This fonction is typically called when a refresh of a displayed is
needed
- Parameters:
nb_lines (Integer.) - The pseudo of the player who sent the message.
nb_car (Integer) - The message itself.
- Returns: Array of nb_lines String
- a list of formatted strings ..
|