/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
//
// BitmapTextDisplay
//
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
#include "CKAll.h"
#include "CKBitmapFont.h"
#define LEFT 1
#define RIGHT 2
#define CENTER 3
CKObjectDeclaration *FillBehaviorBitmapTextDisplayDecl();
CKERROR CreateBitmapTextDisplayProto(CKBehaviorPrototype **pproto);
int BitmapTextDisplay(const CKBehaviorContext& behcontext);
CKERROR BitmapTextDisplayCallBackObject(const CKBehaviorContext& behcontext);
//void BitmapTextRender(CKRenderContext *rc, void *arg);
void BitmapTextRender(CKRenderContext *context, void *arg);
CKObjectDeclaration *FillBehaviorBitmapTextDisplayDecl()
{
CKObjectDeclaration *od = CreateCKObjectDeclaration("BitmapText Display");
od->SetDescription("Displays a Bitmap Text on top of the 3D environment");
/* rem:
On/Reset : activates the behavior, updates the displayed text and reset the inserted lines. Off : deactivates the behavior. Carriage Return : Add a new line to the text to be displayed
Exit On : is activated when the behavior was triggered by 'On' input. Exit Off : is activated when the behavior was triggered by 'Off' input. Line Added : is activated when a new line is added.
Position : x,y position for the text on the screen, in pixels. It represents the top margin in Y and the left margin in X
for the align left mode, the right margin in X for the right aligned mode and the center of the text for center align mode. Character Spacing : Choose the number of pixel between each characters. Default is 1. Scale : Choose the horizontal and vertical scaling of the font. Warning values greater than 2 and smaller than 0.5 lead to disgracious visual effects (Moreover, values < 1 may crash some machines...). Alignment : Choose the justification of the text : either left justified, centered on the position or right justified. Vertical Spacing : When printing several lines with the carriage return input, you can choose here the space (in pixels) to leave between each line. Text : Text you want to display. You can change the type of this parameter to display something else.
Font : The chosen font to be used for displaying the string. The fonc is a 2DSprite with
a fixed set of characters drawn in it, each character separed by vertical lines. The bitmap must start by a vertical line of a
color, followed by some spaces (representing the typical pixels to let for 'space' character) and another vertical
lines + all the other characters.
The characters used are :