Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# Keos::Console::CLookDefault Class Reference

Class defining a personalized look for the console. More...

`#include <KeosConsoleLookDefault.h>`

Inheritance diagram for Keos::Console::CLookDefault:

List of all members.

## Public Member Functions

| CLookDefault (const String &strFont, TVector2F Size, const String &strTexture, const CColor &TextColor=CColor::White, const CColor &TextOkColor=CColor(150, 200, 150), const CColor &TextErrorColor=CColor(200, 150, 150))
| Default constructor.
virtual void | Update ()
| Function called during the update of the console.
virtual void | Draw () const
| Function called during the display of the console.
virtual void | Show (bool bVisible)
| Function called during the activation/deactivation of the console.
virtual void | CommandCalled (const String &strResult)
| Function called after the call to a command.
virtual void | TextChanged (const String &strNewText)
| Function called to every change of the current line.
virtual void | Error (const String &strMessage)
| Function called in case of error.
void | SetTextColors (const CColor &TextColor, const CColor &TextOkColor, const CColor &TextErrorColor)
| Change the colors of the text in console.

## Private Types

enum | TState { STOPPED_VISIBLE, STOPPED_INVISIBLE, HIDDING, SHOWING }
| Console states. More...

## Private Member Functions

void | AddLine (const String &strLine, const CColor &Color)
| Add a line.

## Private Attributes

TModelPtr | m_Background
| Backgroud of the console.
std::list< CGraphicString > | m_Lines
| Last lines shown on the console.
CMatrix4 | m_Transfo
| Matrix of transformation associated to the displaying of the console.
TState | m_State
| State of the animation of the console.
TVector2F | m_nSize
| Size of the console (background).
String | m_strFont
| Resource name for the font.
size_t | m_nFontHeight
| Font height (pixels).
CColor | m_TextColor
| Color of the text seized by the user.
CColor | m_TextErrorColor
| Color of the text resulting from an error.
CColor | m_TextOkColor
| Color of the text returned by a command.

## Detailed Description

Class defining a personalized look for the console.

Definition at line 37 of file KeosConsoleLookDefault.h.

## Member Enumeration Documentation

enum Keos::Console::CLookDefault::TState`[private]`

| Console states.

Enumeration values:

  STOPPED_VISIBLE |
  STOPPED_INVISIBLE |
  HIDDING |
  SHOWING |

Definition at line 102 of file KeosConsoleLookDefault.h.

## Constructor & Destructor Documentation

Keos::Console::CLookDefault::CLookDefault | ( | const String & | strFont,
|  | TVector2F | Size,
|  | const String & | strTexture,
|  | const CColor & | TextColor = `CColor::White`,
|  | const CColor & | TextOkColor = `CColor(150, 200, 150)`,
|  | const CColor & | TextErrorColor = `CColor(200, 150, 150)`
| ) |

| Default constructor.

Parameters:

  | strFont | Resource name for the font.
  | Size | Size of the console.
  | strTexture | File with the texture for the background.
  | TextColor | Color of the text seized by the user.
  | TextOkColor | Color of the text returned by a command.
  | TextErrorColor | Color of the text resulting from an error.

Definition at line 39 of file KeosConsoleLookDefault.cpp.

References AddLine(), Keos::Console::Bind(), m_Background, m_Lines, m_nFontHeight, m_TextColor, m_Transfo, Renderer, Keos::CMatrix4::SetScaling(), Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

## Member Function Documentation

void Keos::Console::CLookDefault::AddLine | ( | const String & | strLine,
|  | const CColor & | Color
| ) | `[private]`

| Add a line.

Parameters:

  | strLine | Text of the new line.
  | Color | Color of the text.

Definition at line 167 of file KeosConsoleLookDefault.cpp.

References int(), m_Lines, m_nFontHeight, m_nSize, m_strFont, and Keos::CVector2< T >::y.

Referenced by CLookDefault(), CommandCalled(), and Error().

void Keos::Console::CLookDefault::CommandCalled | ( | const String & | strResult | ) | `[virtual]`

| Function called after the call to a command. Function to be overloaded to define an ILook.

Parameters:

  | strResult | Result of the call of the command.

Implements Keos::Console::ILook.

Definition at line 142 of file KeosConsoleLookDefault.cpp.

References AddLine(), m_TextColor, and m_TextOkColor.

void Keos::Console::CLookDefault::Draw | ( |  | ) | const`[virtual]`

| Function called during the display of the console. Function to be overloaded to define an ILook. Implements Keos::Console::ILook. Definition at line 111 of file KeosConsoleLookDefault.cpp. References Keos::BLEND_INVSRCALPHA, Keos::BLEND_SRCALPHA, m_Background, m_Lines, m_State, m_Transfo, Keos::MAT_MODELVIEW, Keos::RENDER_ALPHABLEND, Keos::RENDER_ZWRITE, Renderer, and STOPPED_INVISIBLE.

void Keos::Console::CLookDefault::Error | ( | const String & | strMessage | ) | `[virtual]`

| Function called in case of error. Function to be overloaded to define an ILook.

Parameters:

  | strMessage | Message describing the error.

Implements Keos::Console::ILook.

Definition at line 156 of file KeosConsoleLookDefault.cpp.

References AddLine(), m_TextColor, and m_TextErrorColor.

void Keos::Console::CLookDefault::SetTextColors | ( | const CColor & | TextColor,
|  | const CColor & | TextOkColor,
|  | const CColor & | TextErrorColor
| ) | `[inline]`

| Change the colors of the text in console.

Parameters:

  | TextColor | Color of the text seized by the user.
  | TextOkColor | Color of the text returned by a command.
  | TextErrorColor | Color of the text resulting from an error.

Definition at line 92 of file KeosConsoleLookDefault.h.

void Keos::Console::CLookDefault::Show | ( | bool | bVisible | ) | `[virtual]`

| Function called during the activation/deactivation of the console. Function to be overloaded to define an ILook.

Parameters:

  | bVisible | Show/Hide the console (state).

Implements Keos::Console::ILook.

Definition at line 136 of file KeosConsoleLookDefault.cpp.

References HIDDING, m_State, and SHOWING.

void Keos::Console::CLookDefault::TextChanged | ( | const String & | strNewText | ) | `[virtual]`

| Function called to every change of the current line. Function to be overloaded to define an ILook.

Parameters:

  | strNewText | New text.

Implements Keos::Console::ILook.

Definition at line 150 of file KeosConsoleLookDefault.cpp.

References m_Lines.

void Keos::Console::CLookDefault::Update | ( |  | ) | `[virtual]`

| Function called during the update of the console. Function to be overloaded to define an ILook. Implements Keos::Console::ILook. Definition at line 75 of file KeosConsoleLookDefault.cpp. References HIDDING, m_State, m_Transfo, Keos::CMatrix4::SetScaling(), SHOWING, STOPPED_INVISIBLE, and STOPPED_VISIBLE.

## Member Data Documentation

TModelPtr Keos::Console::CLookDefault::m_Background`[private]`

| Backgroud of the console. Definition at line 111 of file KeosConsoleLookDefault.h. Referenced by CLookDefault(), and Draw().

std::list<CGraphicString> Keos::Console::CLookDefault::m_Lines`[private]`

| Last lines shown on the console. Definition at line 113 of file KeosConsoleLookDefault.h. Referenced by AddLine(), CLookDefault(), Draw(), and TextChanged().

size_t Keos::Console::CLookDefault::m_nFontHeight`[private]`

| Font height (pixels). Definition at line 124 of file KeosConsoleLookDefault.h. Referenced by AddLine(), and CLookDefault().

TVector2F Keos::Console::CLookDefault::m_nSize`[private]`

| Size of the console (background). Definition at line 119 of file KeosConsoleLookDefault.h. Referenced by AddLine().

TState Keos::Console::CLookDefault::m_State`[private]`

| State of the animation of the console. Definition at line 117 of file KeosConsoleLookDefault.h. Referenced by Draw(), Show(), and Update().

String Keos::Console::CLookDefault::m_strFont`[private]`

| Resource name for the font. Definition at line 122 of file KeosConsoleLookDefault.h. Referenced by AddLine().

CColor Keos::Console::CLookDefault::m_TextColor`[private]`

| Color of the text seized by the user. Definition at line 126 of file KeosConsoleLookDefault.h. Referenced by CLookDefault(), CommandCalled(), and Error().

CColor Keos::Console::CLookDefault::m_TextErrorColor`[private]`

| Color of the text resulting from an error. Definition at line 128 of file KeosConsoleLookDefault.h. Referenced by Error().

CColor Keos::Console::CLookDefault::m_TextOkColor`[private]`

| Color of the text returned by a command. Definition at line 130 of file KeosConsoleLookDefault.h. Referenced by CommandCalled().

CMatrix4 Keos::Console::CLookDefault::m_Transfo`[private]`

| Matrix of transformation associated to the displaying of the console. Definition at line 115 of file KeosConsoleLookDefault.h. Referenced by CLookDefault(), Draw(), and Update().

The documentation for this class was generated from the following files:

- KeosEngine/KeosConsoleLookDefault.h
- KeosEngine/KeosConsoleLookDefault.cpp