55 lines
1.3 KiB
C++
55 lines
1.3 KiB
C++
/*
|
|
* UIText.h
|
|
*
|
|
* Created on: May 21, 2020
|
|
* Author: ayoungblood
|
|
*/
|
|
|
|
#ifndef SRC_UITEXT_H_
|
|
#define SRC_UITEXT_H_
|
|
|
|
#define ASCII_START_IDX 32
|
|
#define ASCII_COUNT 96
|
|
#define ASCII_ROW_COUNT 16
|
|
|
|
#include <SDL2/SDL.h>
|
|
#include <iostream>
|
|
#include "../game/Game.hpp"
|
|
#include "../assetmgr/TextureManager.h"
|
|
#include "../assetmgr/AssetManager.h"
|
|
|
|
class UIText
|
|
{
|
|
private:
|
|
// SDL_Texture *texture;
|
|
// SDL_Rect srcRect, destRect;
|
|
char letter;
|
|
// int frames = 0;
|
|
// int speed = 100;
|
|
int letterWidth, letterHeight;
|
|
int scale = 1;
|
|
public:
|
|
std::string inputText;
|
|
// int letterHeight;
|
|
// int letterWidth;
|
|
// virtual void init() {}
|
|
// virtual void update() {}
|
|
// virtual void draw() {}
|
|
|
|
Game::groupLabels gameGroup;
|
|
int posX;
|
|
int posY;
|
|
std::string textureID;
|
|
UIText(std::string inputText, std::string texID, int x, int y, int letterW, int letterH, int lScale, std::string tag, Game::groupLabels group);
|
|
~UIText();
|
|
void init() {}
|
|
void update() {}
|
|
void draw() {}
|
|
void AddLetter(int xpos, int ypos, char crnt, std::string tag, int lttrScale, Game::groupLabels groupLabel);
|
|
void ParseString(std::string inputText, int x, int y, int letterScale, std::string tag, Game::groupLabels group);
|
|
// void setTex(std::string id);
|
|
// int scale;
|
|
};
|
|
|
|
#endif /* SRC_UITEXT_H_ */
|