New UITextComponent implemented

This commit is contained in:
2022-02-03 17:59:50 -05:00
parent 40095cb8b7
commit 72a941810d
8 changed files with 212 additions and 141 deletions

View File

@ -8,27 +8,47 @@
#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;
// 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);
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 RemoveAllLetters();
void UpdateString(std::string newInputText);
int scale;
// void setTex(std::string id);
// int scale;
};
#endif /* SRC_UITEXT_H_ */