UI tweaks for more layers and debug

This commit is contained in:
2021-11-07 20:47:58 -05:00
parent 0cc31be0c7
commit b9e9c04235
9 changed files with 84 additions and 75 deletions

View File

@ -31,7 +31,7 @@ UIText::~UIText()
{
}
void UIText::ParseString(std::string inputText, int x, int y, int letterScale, std::string tag)
void UIText::ParseString(std::string inputText, int x, int y, int letterScale, std::string tag, Game::groupLabels group)
{
//Parse input text into an array of char
int posX = x;
@ -51,17 +51,17 @@ void UIText::ParseString(std::string inputText, int x, int y, int letterScale, s
posX = x;
posY += letterHeight;
}
UIText::AddLetter(posX, posY, current, tag, letterScale);
UIText::AddLetter(posX, posY, current, tag, letterScale, group);
current = inputText[i];
} while ((strcmp(&current,"\0"))!=0);
}
void UIText::AddLetter(int xpos, int ypos, char crnt, std::string tag, int lttrScale)
void UIText::AddLetter(int xpos, int ypos, char crnt, std::string tag, int lttrScale, Game::groupLabels groupLabel)
{
auto& letter(manager.addEntity());
letter.addComponent<TransformComponent>(xpos*lttrScale, ypos*lttrScale, letterWidth, letterHeight, 1);
letter.addComponent<SpriteComponent>("font", SpriteComponent::spriteText, crnt, letterWidth, letterHeight, lttrScale);
letter.setTag(tag);
letter.addGroup(Game::groupUI_Layer1);
letter.addGroup(groupLabel);
}