iPcMessenger Struct Reference
This is a messenger property class. More...
#include <propclass/messenger.h>

Public Member Functions | |
| virtual void | ClearAll ()=0 |
| Clear all messages from the log. | |
| virtual void | ClearId (const char *id)=0 |
| Clear a given message id from the log. | |
| virtual void | ClearType (const char *type)=0 |
| Clear all messages from the log with a given type. | |
| virtual void | DefineSlot (const char *name)=0 |
| Define a new message slot. | |
| virtual void | DefineType (const char *type, const char *slot, const csColor4 &textColor, const char *font, int fontSize, float timeout, float fadetime, bool click, bool log, CycleType cyclefirst, CycleType cyclenext)=0 |
| Define a new message type. | |
| virtual const char * | GetDefaultType () const =0 |
| Get the default message type. | |
| virtual csPtr < iMessageLogIterator > | GetMessages (const char *type)=0 |
| Get an iterator over all messages of a given type. | |
| virtual void | Message (const char *type, const char *id, const csStringArray &msgs)=0 |
| Give a message to the user. | |
| virtual void | SetDefaultType (const char *type)=0 |
| Set the default message type. | |
| virtual void | SetSlotBoxAttributes (const char *name, const csColor &boxColor, const csColor4 &borderColor, float borderWidth, int roundness, float boxfadetime)=0 |
| Set the slot box visual attributes. | |
| virtual void | SetSlotDimensions (const char *name, int sizex, int sizey, const char *maxsizex, const char *maxsizey, int marginx, int marginy)=0 |
| Set the slot dimensions. | |
| virtual void | SetSlotMessageHandling (const char *name, int maxmessages, bool queue)=0 |
| Set the slot message handling. | |
| virtual void | SetSlotPosition (const char *name, const csVector2 &position, MessageLocationAnchor boxAnchor, MessageLocationAnchor screenAnchor)=0 |
| Set the slot position. | |
Detailed Description
This is a messenger property class.
This property class can display various types of messages to the user. Every type of message is configurable (with regards to timing, how and where it is displayed, if it is remembered or not, ...)
Locations on screen where messages can be put are defined as 'slots'. There is one predefined slot called 'none' which doesn't display anything.
Messages are grouped in types. A slot can display messages of different types but a single type can only go to one slot.
This property class supports the following actions (add prefix 'cel.messenger.action.' if you want to access this action through a message):
- DefineSlot: parameters: 'name' (string) 'position' (vector2, a position which represents a position of the message box as specified by 'boxanchor'. This position is itself relative to the 'screenanchor'). 'boxanchor' (string, one of c, nw, n, ne, e, se, s, sw, w) 'screenanchor' (string, one of c, nw, n, ne, e, se, s, sw, w) 'sizex' (long, default none): fixed horizontal size. 'sizey' (long, default none): fixed vertical size. 'maxsizex' (string, default '90'): maximum horizontal size (only if sizex is not given) See SetSlotDimensions() for more information about this format. 'maxsizey' (string, default '90'): maximum vertical size (only if sizey is not given) See SetSlotDimensions() for more information about this format. 'marginx' (long, default 5): horizontal margin 'marginy' (long, default 3): vertical margin 'boxcolor' (color4, optional): default is no color (no box) 'bordercolor' (color4, optional): default is no border 'borderwidth' (float, default 0): the width of the border 'roundness' (long, default 0): the roundness of the box corners 'maxmessages' (long, optional): maximum number of active messages that can be displayed at the same time in this slot. The size of the slot can further restrict the actual number of visible messages). 'queue' (boolean, default true): if there are more then maxmessages messages then the messages are kept in a queue until they can be displayed. Otherwise messages push away the oldest messages. 'boxfadetime' (long, default 0)
- DefineType: parameters: 'type' (string): the name of this type. 'slot' (string, default 'none') 'textcolor' (color4, default white) 'font' (string, optional) 'fontsize' (long, optional) 'timeout' (float, default 2.0): time before the message starts fading away 'fadetime' (float, default 1.0): time the message needs to fade away 'click' (bool, default false): first active messages starts fading away faster if the player clicks. 'log' (bool, default false): log messages. If this is set the messages need a unique id. 'cyclefirst' (string, default 'random'): the message selected for the first message.
- random: pick a random message from the message list
- <number>: use a specific message from the list (first is index 0)
- sequence: cycle through all messages in sequence starting with 0. The message will need a unique ID.
- none: no message is given 'cyclenext' (string, optional): this is used if the message has a unique ID and for all messages except the first.
- Message: parameters: 'type' (string, optional, if not set the default type is used) 'id' (string, optional): required in some cases depending on the type. 'msg1' (string). 'msg2' (string, optional). 'msg3' (string, optional). 'msg4' (string, optional). 'msg5' (string, optional). 'msg6' (string, optional). 'msg7' (string, optional).
- SetDefaultType: parameters 'type' (string)
- ClearID: parameters 'id' (string)
Definition at line 142 of file messenger.h.
Member Function Documentation
| virtual void iPcMessenger::ClearAll | ( | ) | [pure virtual] |
Clear all messages from the log.
| virtual void iPcMessenger::ClearId | ( | const char * | id | ) | [pure virtual] |
Clear a given message id from the log.
| virtual void iPcMessenger::ClearType | ( | const char * | type | ) | [pure virtual] |
Clear all messages from the log with a given type.
| virtual void iPcMessenger::DefineSlot | ( | const char * | name | ) | [pure virtual] |
Define a new message slot.
| virtual void iPcMessenger::DefineType | ( | const char * | type, | |
| const char * | slot, | |||
| const csColor4 & | textColor, | |||
| const char * | font, | |||
| int | fontSize, | |||
| float | timeout, | |||
| float | fadetime, | |||
| bool | click, | |||
| bool | log, | |||
| CycleType | cyclefirst, | |||
| CycleType | cyclenext | |||
| ) | [pure virtual] |
Define a new message type.
| virtual const char* iPcMessenger::GetDefaultType | ( | ) | const [pure virtual] |
Get the default message type.
| virtual csPtr<iMessageLogIterator> iPcMessenger::GetMessages | ( | const char * | type | ) | [pure virtual] |
Get an iterator over all messages of a given type.
| virtual void iPcMessenger::Message | ( | const char * | type, | |
| const char * | id, | |||
| const csStringArray & | msgs | |||
| ) | [pure virtual] |
Give a message to the user.
'type' can be 0 in which case the default type is used. 'id' can be 0 in which case this message has no id.
| virtual void iPcMessenger::SetDefaultType | ( | const char * | type | ) | [pure virtual] |
Set the default message type.
| virtual void iPcMessenger::SetSlotBoxAttributes | ( | const char * | name, | |
| const csColor & | boxColor, | |||
| const csColor4 & | borderColor, | |||
| float | borderWidth, | |||
| int | roundness, | |||
| float | boxfadetime | |||
| ) | [pure virtual] |
Set the slot box visual attributes.
| virtual void iPcMessenger::SetSlotDimensions | ( | const char * | name, | |
| int | sizex, | |||
| int | sizey, | |||
| const char * | maxsizex, | |||
| const char * | maxsizey, | |||
| int | marginx, | |||
| int | marginy | |||
| ) | [pure virtual] |
Set the slot dimensions.
maxsizex and maxsizey are strings with the following format:
- '': empty string or 0 means no maximum given. In that case '90' is assumed.
- 'number': a specific dimension
- 'number': a relative dimension (to the maximum screen size). 100 is max.
- '-number': number of pixels less then maximum screen size. If sizex and/or sizey are -1 then they are considered not giving and the box can grow upto the maximum size.
| virtual void iPcMessenger::SetSlotMessageHandling | ( | const char * | name, | |
| int | maxmessages, | |||
| bool | queue | |||
| ) | [pure virtual] |
Set the slot message handling.
| virtual void iPcMessenger::SetSlotPosition | ( | const char * | name, | |
| const csVector2 & | position, | |||
| MessageLocationAnchor | boxAnchor, | |||
| MessageLocationAnchor | screenAnchor | |||
| ) | [pure virtual] |
Set the slot position.
The documentation for this struct was generated from the following file:
- propclass/messenger.h
Generated for CEL: Crystal Entity Layer 2.1 by doxygen 1.6.1
