commit 79d765a2
Add labels to the gamepad help screen. Switch/Push/Back/Confirm are now marked
Changed files
| M | source/code/HelpGamepadState.cpp before |
| M | source/code/HelpGamepadState.hpp before |
diff --git a/source/code/HelpGamepadState.cpp b/source/code/HelpGamepadState.cpp
index 25597cb..d840f1c 100644
--- a/source/code/HelpGamepadState.cpp
+++ b/source/code/HelpGamepadState.cpp
@@ -35,6 +35,18 @@ HelpGamepadState::HelpGamepadState() {
pushLabel.SetFontSize(30);
pushLabel.SetOutline(1, {128,128,128,255});
pushLabel.SetText(_("Push line"));
+ backLabel.SetHolder(&globalData.spriteHolder->GetDataHolder());
+ backLabel.SetFontSize(30);
+ backLabel.SetOutline(1, {128,128,128,255});
+ backLabel.SetText(_("Back (Menu)"));
+ switchLabel.SetHolder(&globalData.spriteHolder->GetDataHolder());
+ switchLabel.SetFontSize(30);
+ switchLabel.SetOutline(1, {128,128,128,255});
+ switchLabel.SetText(_("Switch"));
+ confirmLabel.SetHolder(&globalData.spriteHolder->GetDataHolder());
+ confirmLabel.SetFontSize(30);
+ confirmLabel.SetOutline(1, {128,128,128,255});
+ confirmLabel.SetText(_("Confirm"));
}
@@ -67,6 +79,22 @@ void HelpGamepadState::Draw(SDL_Renderer* target) {
SDL_RenderDrawLine(target, globalData.xsize/2-480/2+140, 90, globalData.xsize/2+480/2-140, 90);
SDL_RenderDrawLine(target, globalData.xsize/2, 80, globalData.xsize/2, 90);
pushLabel.Draw(target, globalData.xsize/2, 80, sago::SagoTextField::Alignment::center, sago::SagoTextField::VerticalAlignment::bottom);
+ SDL_RenderDrawLine(target, 625, 168, 800, 168);
+ SDL_RenderDrawLine(target, 800, 158, 800, 168);
+ backLabel.Draw(target, 800, 156, sago::SagoTextField::Alignment::center, sago::SagoTextField::VerticalAlignment::bottom);
+ SDL_RenderDrawLine(target, 625, 241, 900, 241);
+ SDL_RenderDrawLine(target, 663, 207, 900, 207);
+ SDL_RenderDrawLine(target, 900, 207, 900, 400);
+ switchLabel.Draw(target, 900, 404, sago::SagoTextField::Alignment::center);
+ confirmLabel.Draw(target, 900, 404+30, sago::SagoTextField::Alignment::center);
+#if 1
+ static sago::SagoTextField mousePos;
+ mousePos.SetHolder(&globalData.spriteHolder->GetDataHolder());
+ mousePos.SetFontSize(16);
+ mousePos.SetOutline(1, {128,128,128,255});
+ mousePos.SetText(std::string("Mouse position: ")+std::to_string(globalData.mousex)+std::string(", ")+std::to_string(globalData.mousey));
+ mousePos.Draw(target, 0,0);
+#endif
}
void HelpGamepadState::Update() {
diff --git a/source/code/HelpGamepadState.hpp b/source/code/HelpGamepadState.hpp
index e39f558..d3b0cdd 100644
--- a/source/code/HelpGamepadState.hpp
+++ b/source/code/HelpGamepadState.hpp
@@ -43,6 +43,9 @@ private:
bool isActive = true;
sago::SagoTextField moveLabel;
sago::SagoTextField pushLabel;
+ sago::SagoTextField backLabel;
+ sago::SagoTextField switchLabel;
+ sago::SagoTextField confirmLabel;
private:
};