Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Ndk::Console Class Reference

NDK class that represents a console to help development with Lua scripting. More...

Inherits Nz::Node, and Nz::HandledObject< T >.

Public Member Functions

 Console (World &world, const Nz::Vector2f &size, Nz::LuaState &state)
 Constructs a Console object with a world to interact with. More...
 
 Console (const Console &console)=delete
 
 Console (Console &&console)=default
 
void AddLine (const Nz::String &text, const Nz::Color &color=Nz::Color::White)
 Adds a line to the console. More...
 
void Clear ()
 Clears the console.
 
unsigned int GetCharacterSize () const
 Gets the character size. More...
 
const EntityHandle & GetHistory () const
 Gets the entity representing the history of the console. More...
 
const EntityHandle & GetHistoryBackground () const
 Gets the entity representing the background of the console's history. More...
 
const EntityHandle & GetInput () const
 Gets the entity representing the input of the console. More...
 
const EntityHandle & GetInputBackground () const
 Gets the entity representing the background of the console's input. More...
 
const Nz::Vector2f & GetSize () const
 Gets the size of the console. More...
 
const Nz::FontRef & GetTextFont () const
 Gets the font used by the console. More...
 
bool IsVisible () const
 Checks whether the console is visible. More...
 
void SendCharacter (char32_t character)
 Sends a character to the console. More...
 
void SendEvent (const Nz::WindowEvent &event)
 Sends an event to the console. More...
 
void SetCharacterSize (unsigned int size)
 Sets the character size. More...
 
void SetSize (const Nz::Vector2f &size)
 Sets the console size. More...
 
void SetTextFont (Nz::FontRef font)
 Sets the text font. More...
 
void Show (bool show=true)
 Shows the console. More...
 
Console & operator= (const Console &console)=delete
 
Console & operator= (Console &&console)=default
 

Detailed Description

NDK class that represents a console to help development with Lua scripting.

Constructor & Destructor Documentation

◆ Console()

Ndk::Console::Console ( World &  world,
const Nz::Vector2f &  size,
Nz::LuaState &  state 
)

Constructs a Console object with a world to interact with.

Parameters
worldWorld to interact with
size(Width, Height) of the console
instanceLua instance that will interact with the world

Member Function Documentation

◆ AddLine()

void Ndk::Console::AddLine ( const Nz::String &  text,
const Nz::Color &  color = Nz::Color::White 
)

Adds a line to the console.

Parameters
textNew line of text
colorColor for the text

◆ GetCharacterSize()

unsigned int Ndk::Console::GetCharacterSize ( ) const
inline

Gets the character size.

Returns
Height of the character

◆ GetHistory()

const EntityHandle & Ndk::Console::GetHistory ( ) const
inline

Gets the entity representing the history of the console.

Returns
History of the console

◆ GetHistoryBackground()

const EntityHandle & Ndk::Console::GetHistoryBackground ( ) const
inline

Gets the entity representing the background of the console's history.

Returns
Background history of the console

◆ GetInput()

const EntityHandle & Ndk::Console::GetInput ( ) const
inline

Gets the entity representing the input of the console.

Returns
Input of the console

◆ GetInputBackground()

const EntityHandle & Ndk::Console::GetInputBackground ( ) const
inline

Gets the entity representing the background of the console's input.

Returns
Background input of the console

◆ GetSize()

const Nz::Vector2f & Ndk::Console::GetSize ( ) const
inline

Gets the size of the console.

Returns
Size (Width, Height) of the console

◆ GetTextFont()

const Nz::FontRef & Ndk::Console::GetTextFont ( ) const
inline

Gets the font used by the console.

Returns
A reference to the font currenty used

◆ IsVisible()

bool Ndk::Console::IsVisible ( ) const
inline

Checks whether the console is visible.

Returns
true If it is the case

◆ SendCharacter()

void Ndk::Console::SendCharacter ( char32_t  character)

Sends a character to the console.

Parameters
characterCharacter that will be added to the console

◆ SendEvent()

void Ndk::Console::SendEvent ( const Nz::WindowEvent &  event)

Sends an event to the console.

Parameters
eventEvent to be takin into consideration by the console

◆ SetCharacterSize()

void Ndk::Console::SetCharacterSize ( unsigned int  size)

Sets the character size.

Parameters
sizeSize of the font

◆ SetSize()

void Ndk::Console::SetSize ( const Nz::Vector2f &  size)

Sets the console size.

Parameters
size(Width, Height) of the console

◆ SetTextFont()

void Ndk::Console::SetTextFont ( Nz::FontRef  font)

Sets the text font.

Parameters
fontReference to a valid font
Remarks
Produces a NazaraAssert if font is invalid or null

◆ Show()

void Ndk::Console::Show ( bool  show = true)

Shows the console.

Parameters
showShould the console be showed

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