Basic WordWrap for UIText feature

This commit is contained in:
2022-02-04 17:08:01 -05:00
parent 72a941810d
commit b5639e4f41
3 changed files with 6 additions and 12 deletions

View File

@ -151,7 +151,7 @@ void Game::init(const char *title, int width, int height, bool fullscreen, int g
my9Slice = new UINineSlice("textBox");
my9Slice->MakeSlices("textBox",32,32,14,16,14,16,myDestRect,globalScale,Game::groupUI_Layer0);
uiInfo.addComponent<TransformComponent>(160,120,64,32,1);
uiInfo.addComponent<TransformComponent>(10,10,180,56,1);
uiInfo.addComponent<UITextComponent>("font", "UI Text works again!", 8, 12, 1);
uiInfo.addGroup(groupUI_Layer3);
// debug UI text
@ -258,7 +258,7 @@ void Game::update()
SDL_Rect playerCol = player.getComponent<ColliderComponent>().collider;
Vector2D playerPos = player.getComponent<TransformComponent>().position;
uiInfo.getComponent<UITextComponent>().updateString("New Text Works!");
uiInfo.getComponent<UITextComponent>().updateString("Updating UIText works well, even with basic word wrap for new lines.");
// if (gsm->currentState == GameStateManager::ST_INIT)
// {