[Updated] Backgrounds to display the desired portion of the image, [Added] Start of the Game class

This commit is contained in:
Ninjaws
2024-12-09 22:29:08 +01:00
parent 76dd80d3a3
commit cbf6e658ea
15 changed files with 323 additions and 143 deletions
+16 -2
View File
@@ -4,8 +4,7 @@
#include "EFont.h"
#include "EScreen.h"
TutorialScreen::TutorialScreen()
{
TutorialScreen::TutorialScreen() {
Text textBack = Text("Press Enter to go back", EFont::SANSATION, 30, 0, RED);
textBack.setPosition({(float)(GetScreenWidth() - textBack.getDimensions().x) / 1.3f,
(float)(GetScreenHeight() - textBack.getDimensions().y) / 1.15f});
@@ -21,3 +20,18 @@ void TutorialScreen::logic()
StateService::getInstance().setScreen(EScreen::MAIN);
}
}
void TutorialScreen::draw()
{
BeginDrawing();
this->background.draw();
if (text.size() > 0)
{
for (int t = 0; t < text.size(); t++)
{
text[t].draw();
}
}
EndDrawing();
}