GameKit  0.0.1a
C++ gamedev tools
Public Member Functions | Private Member Functions | Private Attributes | List of all members
gk::TextInput Class Reference

#include <TextInput.hpp>

Inheritance diagram for gk::TextInput:
gk::IDrawable gk::Transformable

Public Member Functions

 TextInput ()
 
void onEvent (const SDL_Event &event)
 
const std::string & content () const
 
Vector2f getSize () const
 
void setPosition (float x, float y)
 
void setSize (u16 width, u16 height)
 
void setCharacterLimit (u16 characterLimit)
 
void setContent (const std::string &content)
 
void setKeyboardSound (const std::string &keyboardSound)
 
void setCursor (const std::string &cursor)
 
- Public Member Functions inherited from gk::IDrawable
virtual ~IDrawable ()=default
 Virtual destructor. More...
 
- Public Member Functions inherited from gk::Transformable
virtual ~Transformable ()=default
 
void setPosition (float x, float y, float z=0)
 
void setPosition (const Vector3f &position)
 
void setOrigin (float x, float y, float z=0)
 
void setOrigin (const Vector3f &origin)
 
void setScale (float factorX, float factorY, float factorZ=1)
 
void setScale (const Vector3f &factors)
 
void setRotation (float angle)
 
void setRotation (float angle, const Vector3f &axis)
 
const Vector3fgetPosition () const
 
const Vector3fgetOrigin () const
 
const Vector3fgetScale () const
 
float getRotation () const
 
void move (float offsetX, float offsetY, float offsetZ=0)
 
void move (const Vector3f &offset)
 
void scale (float factorX, float factorY, float factorZ=1)
 
void scale (const Vector3f &factor)
 
void rotate (float angle)
 
void rotate (float angle, const Vector3f &axis)
 
const TransformgetTransform () const
 

Private Member Functions

void draw (RenderTarget &target, RenderStates states) const override
 Draw the object to a render target. More...
 

Private Attributes

RectangleShape m_rectText
 
Text m_text
 
std::string m_content
 
u16 m_characterLimit = 0
 
std::string m_keyboardSound
 
std::string m_cursor = "|"
 

Additional Inherited Members

Detailed Description

Definition at line 23 of file TextInput.hpp.

Constructor & Destructor Documentation

§ TextInput()

gk::TextInput::TextInput ( )

Definition at line 20 of file TextInput.cpp.

Member Function Documentation

§ content()

const std::string& gk::TextInput::content ( ) const
inline

Definition at line 29 of file TextInput.hpp.

§ draw()

void gk::TextInput::draw ( RenderTarget target,
RenderStates  states 
) const
overrideprivatevirtual

Draw the object to a render target.

This is a pure virtual function that has to be implemented by the derived class to define how the drawable should be drawn.

Parameters
targetRender target to draw to
statesCurrent render states

Implements gk::IDrawable.

Definition at line 64 of file TextInput.cpp.

§ getSize()

Vector2f gk::TextInput::getSize ( ) const
inline

Definition at line 31 of file TextInput.hpp.

§ onEvent()

void gk::TextInput::onEvent ( const SDL_Event &  event)

Definition at line 39 of file TextInput.cpp.

§ setCharacterLimit()

void gk::TextInput::setCharacterLimit ( u16  characterLimit)
inline

Definition at line 35 of file TextInput.hpp.

§ setContent()

void gk::TextInput::setContent ( const std::string &  content)
inline

Definition at line 36 of file TextInput.hpp.

§ setCursor()

void gk::TextInput::setCursor ( const std::string &  cursor)
inline

Definition at line 38 of file TextInput.hpp.

§ setKeyboardSound()

void gk::TextInput::setKeyboardSound ( const std::string &  keyboardSound)
inline

Definition at line 37 of file TextInput.hpp.

§ setPosition()

void gk::TextInput::setPosition ( float  x,
float  y 
)

Definition at line 30 of file TextInput.cpp.

§ setSize()

void gk::TextInput::setSize ( u16  width,
u16  height 
)

Definition at line 35 of file TextInput.cpp.

Member Data Documentation

§ m_characterLimit

u16 gk::TextInput::m_characterLimit = 0
private

Definition at line 48 of file TextInput.hpp.

§ m_content

std::string gk::TextInput::m_content
private

Definition at line 46 of file TextInput.hpp.

§ m_cursor

std::string gk::TextInput::m_cursor = "|"
private

Definition at line 52 of file TextInput.hpp.

§ m_keyboardSound

std::string gk::TextInput::m_keyboardSound
private

Definition at line 50 of file TextInput.hpp.

§ m_rectText

RectangleShape gk::TextInput::m_rectText
private

Definition at line 43 of file TextInput.hpp.

§ m_text

Text gk::TextInput::m_text
private

Definition at line 45 of file TextInput.hpp.


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