container for text, can select from given fonts/colors give the path to your own string font path / SDL colors.
More...
#include <TextBox.h>
|
| 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.
|
|
container for text, can select from given fonts/colors give the path to your own string font path / SDL colors.
◆ changeBackgroundColor()
void TextBox::changeBackgroundColor |
( |
SDL_Color |
color | ) |
|
Changes the background color of the text.
- Parameters
-
◆ changePosition()
void TextBox::changePosition |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
Changes the position of the text.
- Parameters
-
◆ changeText()
void TextBox::changeText |
( |
std::string |
text | ) |
|
Changes the contents of the text.
- Parameters
-
◆ changeTextColor()
void TextBox::changeTextColor |
( |
SDL_Color |
color | ) |
|
Changes the color of the text.
- Parameters
-
◆ 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,when | invoking, you can usually obtain this with getRenderer() e.g. myTextBox.render(getRenderer())
|
The documentation for this class was generated from the following file: