diff --git a/build/BeagleRescue b/build/BeagleRescue index de25c6a..2d45efb 100755 Binary files a/build/BeagleRescue and b/build/BeagleRescue differ diff --git a/src/game/Game.cpp b/src/game/Game.cpp index 9c915f6..9f1a3d9 100644 --- a/src/game/Game.cpp +++ b/src/game/Game.cpp @@ -162,38 +162,40 @@ void Game::init(const char *title, int width, int height, bool fullscreen, int g std::string debugStaticString = "Collision"; debugStaticText = new UIText(debugStaticString, "font", 0,0,8,12,1); - debugStaticText->ParseString(debugStaticString,220*globalScale,14*gScale,1,"debug",Game::groupUI_Layer3); + debugStaticText->ParseString(debugStaticString,camera.w-100*globalScale,14*gScale,1,"debug",Game::groupUI_Layer3); std::string debugStaticString2 = "Hori:"; debugStaticText2 = new UIText(debugStaticString2, "font", 0,0,8,12,1); - debugStaticText2->ParseString(debugStaticString2,220*globalScale,24*gScale,1,"debug",Game::groupUI_Layer3); + debugStaticText2->ParseString(debugStaticString2,camera.w-100*globalScale,24*gScale,1,"debug",Game::groupUI_Layer3); std::string debugStaticString3 = "Vert:"; debugStaticText3 = new UIText(debugStaticString3, "font", 0,0,8,12,1); - debugStaticText3->ParseString(debugStaticString3,220*globalScale,34*gScale,1,"debug",Game::groupUI_Layer3); + debugStaticText3->ParseString(debugStaticString3,camera.w-100*globalScale,34*gScale,1,"debug",Game::groupUI_Layer3); std::string debugStaticString4 = "Jump:"; debugStaticText4 = new UIText(debugStaticString4, "font", 0,0,8,12,1); - debugStaticText4->ParseString(debugStaticString4,220*globalScale,44*gScale,1,"debug",Game::groupUI_Layer3); + debugStaticText4->ParseString(debugStaticString4,camera.w-100*globalScale,44*gScale,1,"debug",Game::groupUI_Layer3); std::string debugStaticString5 = "P.y :"; debugStaticText5 = new UIText(debugStaticString5, "font", 0,0,8,12,1); - debugStaticText5->ParseString(debugStaticString5,220*globalScale,54*gScale,1,"debug",Game::groupUI_Layer3); + debugStaticText5->ParseString(debugStaticString5,camera.w-100*globalScale,54*gScale,1,"debug",Game::groupUI_Layer3); std::string debugStaticString6 = "P.dy:"; debugStaticText6 = new UIText(debugStaticString6, "font", 0,0,8,12,1); - debugStaticText6->ParseString(debugStaticString6,220*globalScale,64*gScale,1,"debug",Game::groupUI_Layer3); + debugStaticText6->ParseString(debugStaticString6,camera.w-100*globalScale,64*gScale,1,"debug",Game::groupUI_Layer3); std::string debugStaticString7 = "YVec:"; debugStaticText7 = new UIText(debugStaticString7, "font", 0,0,8,12,1); - debugStaticText7->ParseString(debugStaticString7,220*globalScale,74*gScale,1,"debug",Game::groupUI_Layer3); + debugStaticText7->ParseString(debugStaticString7,camera.w-100*globalScale,74*gScale,1,"debug",Game::groupUI_Layer3); debugJumpText = new UIText(Game::BoolToString(playerIsJumping), "font", 0,0,8,12,1); - debugJumpText->ParseString(Game::BoolToString(playerIsJumping),260*globalScale,44*gScale,1,"debugJumpText",Game::groupUI_Layer3); + debugJumpText->ParseString(Game::BoolToString(playerIsJumping),camera.w-50*globalScale,44*gScale,1,"debugJumpText",Game::groupUI_Layer3); // debug UI box SDL_Rect debugBoxRect = SDL_Rect(); - debugBoxRect.x = 220*globalScale; + debugBoxRect.x = camera.w-(100*globalScale); debugBoxRect.y = 8*globalScale; debugBoxRect.w = 98*globalScale; debugBoxRect.h = 94*globalScale; debugBox = new UINineSlice("textBox"); debugBox->MakeSlices("textBox",32,32,14,16,14,16,debugBoxRect,1,Game::groupUI_Layer2); + printf("camera.w: %d \n",camera.w); + //ecs implementation map->LoadMap("assets/maps/br-map-color.txt",70,45, globalScale); diff --git a/src/ui/UIText.cpp b/src/ui/UIText.cpp index b5d34f3..67b384d 100644 --- a/src/ui/UIText.cpp +++ b/src/ui/UIText.cpp @@ -59,6 +59,7 @@ void UIText::ParseString(std::string inputText, int x, int y, int letterScale, s void UIText::AddLetter(int xpos, int ypos, char crnt, std::string tag, int lttrScale, Game::groupLabels groupLabel) { +// =======THIS NEEDS TO BE REFACTORED TO NOT USE INDIVIDUAL ENTITIES FOR EACH LETTER============ auto& letter(manager.addEntity()); letter.addComponent(xpos*lttrScale, ypos*lttrScale, letterWidth, letterHeight, 1); letter.addComponent("font", SpriteComponent::spriteText, crnt, letterWidth, letterHeight, lttrScale);