Archimedes/Dash Da Capo!
Loading...
Searching...
No Matches
Public Member Functions | List of all members
TextBox Class Reference

container for text, can select from given fonts/colors give the path to your own string font path / SDL colors. More...

#include <TextBox.h>

Public Member Functions

 TextBox (std::string text, int fontSize, int x, int y, int w, int h, std::string inputFont="../../assets/fonts/Roboto-Medium.ttf", SDL_Color textColor={255, 0, 0, 255}, SDL_Color backgroundColor={0, 0, 0, 0}, bool isClear=false)
 
void render (SDL_Renderer *renderer)
 Renders the given textbox.
 
void changeText (std::string text)
 Changes the contents of the text.
 
void changeDimensions (int w, int h)
 
void changePosition (int x, int y)
 Changes the position of the text.
 
void changeTextColor (SDL_Color color)
 Changes the color of the text.
 
void changeBackgroundColor (SDL_Color color)
 Changes the background color of the text.
 
int getBottomY () const
 Unsuccesful attempt to get the bottom of the hitbox AFTER the text size gets fitted properly.
 

Detailed Description

container for text, can select from given fonts/colors give the path to your own string font path / SDL colors.

Member Function Documentation

◆ changeBackgroundColor()

void TextBox::changeBackgroundColor ( SDL_Color  color)

Changes the background color of the text.

Parameters
color

◆ changePosition()

void TextBox::changePosition ( int  x,
int  y 
)

Changes the position of the text.

Parameters
x
y

◆ changeText()

void TextBox::changeText ( std::string  text)

Changes the contents of the text.

Parameters
text

◆ changeTextColor()

void TextBox::changeTextColor ( SDL_Color  color)

Changes the color of the text.

Parameters
color

◆ getBottomY()

int TextBox::getBottomY ( ) const

Unsuccesful attempt to get the bottom of the hitbox AFTER the text size gets fitted properly.

Returns

◆ render()

void TextBox::render ( SDL_Renderer *  renderer)

Renders the given textbox.

Parameters
renderer,wheninvoking, you can usually obtain this with getRenderer() e.g. myTextBox.render(getRenderer())

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