Skip to content

Commit

Permalink
update text alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
fallahn committed Sep 5, 2024
1 parent 552cae0 commit b146017
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions samples/golf/buildnumber.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef BUILD_NUMBER_H_
#define BUILD_NUMBER_H_

#define BUILDNUMBER 7152
#define BUILDNUMBER_STR "7152"
#define BUILDNUMBER 7154
#define BUILDNUMBER_STR "7154"

#endif /* BUILD_NUMBER_H_ */
6 changes: 3 additions & 3 deletions samples/golf/src/golf/LeaderboardState.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*-----------------------------------------------------------------------
Matt Marchant 2023
Matt Marchant 2023 - 2024
http://trederia.blogspot.com
Super Video Golf - zlib licence.
Expand Down Expand Up @@ -489,7 +489,7 @@ void LeaderboardState::buildScene()

//leaderboard names text
entity = m_scene.createEntity();
entity.addComponent<cro::Transform>().setPosition({ 22.f, 216.f });
entity.addComponent<cro::Transform>().setPosition({ 22.f, 216.f, 0.1f });
entity.addComponent<cro::Drawable2D>();
entity.addComponent<cro::Text>(font).setCharacterSize(UITextSize);
entity.getComponent<cro::Text>().setVerticalSpacing(LeaderboardTextSpacing);
Expand All @@ -500,7 +500,7 @@ void LeaderboardState::buildScene()

//leaderboard scores text
entity = m_scene.createEntity();
entity.addComponent<cro::Transform>().setPosition({ 288.f, 216.f });
entity.addComponent<cro::Transform>().setPosition({ 288.f, 216.f, 0.1f });
entity.addComponent<cro::Drawable2D>();
entity.addComponent<cro::Text>(font).setCharacterSize(UITextSize);
entity.getComponent<cro::Text>().setVerticalSpacing(LeaderboardTextSpacing);
Expand Down
16 changes: 8 additions & 8 deletions samples/golf/src/golf/LeagueState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ void LeagueState::createGlobalLeagueTab(cro::Entity parent, const cro::SpriteShe
const auto& largeFont = m_sharedData.sharedResources->fonts.get(FontID::UI);

auto entity = m_scene.createEntity();
entity.addComponent<cro::Transform>().setPosition({ centre, 298.f, 0.1f });
entity.addComponent<cro::Transform>().setPosition({ centre, 298.f, 0.2f });
entity.addComponent<cro::Drawable2D>();
entity.addComponent<cro::Text>(largeFont).setString("Global League for " + MonthStrings[Social::getMonth()]);
entity.getComponent<cro::Text>().setCharacterSize(UITextSize);
Expand All @@ -1170,7 +1170,7 @@ void LeagueState::createGlobalLeagueTab(cro::Entity parent, const cro::SpriteShe

auto stripeEnt = entity;
entity = m_scene.createEntity();
entity.addComponent<cro::Transform>().setPosition({ 4.f, 219.f, 0.1f });
entity.addComponent<cro::Transform>().setPosition({ 4.f, 219.f, 0.2f });
entity.addComponent<cro::Drawable2D>();
entity.addComponent<cro::Text>(largeFont).setString("P/Cm");
entity.getComponent<cro::Text>().setCharacterSize(UITextSize);
Expand All @@ -1185,7 +1185,7 @@ void LeagueState::createGlobalLeagueTab(cro::Entity parent, const cro::SpriteShe
const auto& str = Social::getMonthlyLeague();
const auto& smallFont = m_sharedData.sharedResources->fonts.get(FontID::Label);
entity = m_scene.createEntity();
entity.addComponent<cro::Transform>().setPosition({ 68.f, TextTop + 1.f, 0.1f });
entity.addComponent<cro::Transform>().setPosition({ 68.f, TextTop + 1.f, 0.2f });
entity.addComponent<cro::Drawable2D>();
entity.addComponent<cro::Text>(smallFont).setString(str[2]);
entity.getComponent<cro::Text>().setFillColour(LeaderboardTextDark);
Expand All @@ -1196,7 +1196,7 @@ void LeagueState::createGlobalLeagueTab(cro::Entity parent, const cro::SpriteShe

//str = "Big\nJim\nBeef\nFrank\nSteve\nMelissa\nJean\nSavoury\nRegina Philange Banana Hammock";
entity = m_scene.createEntity();
entity.addComponent<cro::Transform>().setPosition({ 114.f, TextTop + 1.f, 0.1f });
entity.addComponent<cro::Transform>().setPosition({ 114.f, TextTop + 1.f, 0.2f });
entity.addComponent<cro::Drawable2D>();
entity.addComponent<cro::Text>(smallFont).setString(str[0]);
entity.getComponent<cro::Text>().setFillColour(LeaderboardTextDark);
Expand All @@ -1206,7 +1206,7 @@ void LeagueState::createGlobalLeagueTab(cro::Entity parent, const cro::SpriteShe

//str = " 1 Point\n 20 Points\n120 Points\n 1 Point\n 20 Points\n120 Points\n 1 Point\n 20 Points\n120 Points\n 1 Point\n 20 Points\n120 Points\n 1 Point\n 20 Points\n120 Points\n123 Points";
entity = m_scene.createEntity();
entity.addComponent<cro::Transform>().setPosition({ 437.f, TextTop + 1.f, 0.1f });
entity.addComponent<cro::Transform>().setPosition({ 437.f, TextTop + 1.f, 0.2f });
entity.addComponent<cro::Drawable2D>();
entity.addComponent<cro::Text>(smallFont).setString(str[1]);
entity.getComponent<cro::Text>().setFillColour(LeaderboardTextDark);
Expand All @@ -1217,7 +1217,7 @@ void LeagueState::createGlobalLeagueTab(cro::Entity parent, const cro::SpriteShe

//auto statusString = "PLAYER SCORE HERE";
entity = m_scene.createEntity();
entity.addComponent<cro::Transform>().setPosition({ centre, 59.f, 0.1f });
entity.addComponent<cro::Transform>().setPosition({ centre, 59.f, 0.2f });
entity.addComponent<cro::Drawable2D>();
entity.addComponent<cro::Text>(largeFont).setString(str[3]);
entity.getComponent<cro::Text>().setCharacterSize(UITextSize);
Expand All @@ -1231,7 +1231,7 @@ void LeagueState::createGlobalLeagueTab(cro::Entity parent, const cro::SpriteShe
//how to play
auto statusString = "To compete play through all 36 rounds in Free Play";
entity = m_scene.createEntity();
entity.addComponent<cro::Transform>().setPosition({ centre, 50.f, 0.1f });
entity.addComponent<cro::Transform>().setPosition({ centre, 50.f, 0.2f });
entity.addComponent<cro::Drawable2D>();
entity.addComponent<cro::Text>(smallFont).setString(statusString);
entity.getComponent<cro::Text>().setCharacterSize(LabelTextSize);
Expand All @@ -1244,7 +1244,7 @@ void LeagueState::createGlobalLeagueTab(cro::Entity parent, const cro::SpriteShe

//text scroller
entity = m_scene.createEntity();
entity.addComponent<cro::Transform>().setPosition({ 0.f, 13.f, 0.25f });
entity.addComponent<cro::Transform>().setPosition({ 0.f, 15.f, 0.25f });
entity.addComponent<cro::Drawable2D>();
entity.addComponent<cro::Text>(smallFont).setString("-~-");// .setString("this is a test string. nothing to see here people, move along.");
entity.getComponent<cro::Text>().setFillColour(TextNormalColour);
Expand Down

0 comments on commit b146017

Please sign in to comment.