My Fishing World
Android 4.4+
Version:1.15.109
55.2 MB
Download
/// Constructor for setting the font, size, colour, position and text of the text object.
///
/// Font of the text to be used
/// String of text to be used
/// Text size to be used
/// X Position of origin of text object
/// Y Position of origin of text object
/// Color of text object
Text::Text(sf::Font& t_font, std::string t_string, int t_size, float t_x, float t_y, sf::Color t_colour)
{
m_text.setFont(t_font);
m_text.setString(t_string);
m_text.setCharacterSize(t_size);
m_text.setFillColor(t_colour);
m_text.setOrigin(m_text.getGlobalBounds().width / 2, m_text.getGlobalBounds().height / 2);
m_text.setPosition(t_x, t_y);
}
Text::~Text()
{
}
///
/// Sets the origin of the text to be in the centre of the text.
///
void Text::centerText()
{
m_text.setOrigin(m_text.getGlobalBounds().width / 2, m_text.getGlobalBounds().height / 2);
}
///
/// Sets the text's string to param t_text.
///
/// The text to replace the current string
void Text::UpdateText(std::string t_text)
{
m_text.setString(t_text);
m_text.setOrigin(m_text.getGlobalBounds().width / 2, m_text.getGlobalBounds().height / 2);
}
///
/// Adjusts the text's position to align with the rectangle it is overlapping.
///
/// rectangle to be aligned in the center of
void Text::AlignText(sf::RectangleShape t_button)
{
m_text.setPosition(t_button.getPosition().x, t_button.getPosition().y);
}
Full Content
My Fishing World
Android 4.4+
Version:1.15.109
55.2 MB
/// Constructor for setting the font, size, colour, position and text of the text object.
///
/// Font of the text to be used
/// String of text to be used
/// Text size to be used
/// X Position of origin of text object
/// Y Position of origin of text object
/// Color of text object
Text::Text(sf::Font& t_font, std::string t_string, int t_size, float t_x, float t_y, sf::Color t_colour)
{
m_text.setFont(t_font);
m_text.setString(t_string);
m_text.setCharacterSize(t_size);
m_text.setFillColor(t_colour);
m_text.setOrigin(m_text.getGlobalBounds().width / 2, m_text.getGlobalBounds().height / 2);
m_text.setPosition(t_x, t_y);
}
Text::~Text()
{
}
///
/// Sets the origin of the text to be in the centre of the text.
///
void Text::centerText()
{
m_text.setOrigin(m_text.getGlobalBounds().width / 2, m_text.getGlobalBounds().height / 2);
}
///
/// Sets the text's string to param t_text.
///
/// The text to replace the current string
void Text::UpdateText(std::string t_text)
{
m_text.setString(t_text);
m_text.setOrigin(m_text.getGlobalBounds().width / 2, m_text.getGlobalBounds().height / 2);
}
///
/// Adjusts the text's position to align with the rectangle it is overlapping.
///
/// rectangle to be aligned in the center of
void Text::AlignText(sf::RectangleShape t_button)
{
m_text.setPosition(t_button.getPosition().x, t_button.getPosition().y);
}
FULL Content
My Fishing World Screenshots