Wraith  0.1.5
Basic 3D game engine in C++
ScreenLog

The ScreenLog is used for displaying console messages on the game screen. More...

Collaboration diagram for ScreenLog:

Functions

static void ScreenLog::SetRenderAnchor (int anchorX, int anchorY)
 Sets render anchor. More...
 
static void ScreenLog::Add (char *format,...)
 Adds format. More...
 

Detailed Description

The ScreenLog is used for displaying console messages on the game screen.

The ScreenLog is a visual alternative to the writing messages in the console. This prints out messages directly onto the game screen. Function call to print a message similar to printf(char* format, ...) taking Messages appear on the top left corner. You must include ScreenLog.h header file

Here is an example of how the ScreenLog could be used.

#include "ScreenLog.h"
// NOTE: Tank has Vect variable called _position
Tank::Tank()
{
_position = Vect(0.0f, 0.0f, 0.0f);
}
void Tank::update()
{
this->move();
// This is where ScreenLog::Add() is called to print a message
// NOTE: ScreenLog::Add() can be called anywhere, not just here
ScreenLog::Add("Tank position: (%3.1f, %3.1f, %3.1f)", _position[x], _position[y], _position[z]);
}
void Tank::move()
{
\\ moves tank and updates _position
}
static void Add(char *format,...)
Adds format.
Definition: ScreenLog.h:75
void submitUpdateRegistration()
Submit update registration to current scene.
Definition: Updatable.cpp:24

Function Documentation

◆ Add()

static void ScreenLog::Add ( char *  format,
  ... 
)
inlinestatic

Adds format.

Parameters
formatdescribes the string format to use.
...Variable arguments providing additional information of what to print.

◆ SetRenderAnchor()

static void ScreenLog::SetRenderAnchor ( int  anchorX,
int  anchorY 
)
inlinestatic

Sets render anchor.

Parameters
anchorXThe anchor x coordinate.
anchorYThe anchor y coordinate.