My Fishing World

Android 4.4+
版本:1.15.109
55.2 MB
下载

/// 用于设置文本对象的字体、大小、颜色、位置和文本的构造函数。 /// 要使用的文本字体 /// 要使用的文本字符串 /// 要使用的文本大小 /// 文本对象原点的 X 坐标 /// 文本对象原点的 Y 坐标 /// 文本对象的颜色 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() { } ///

/// 将文本的原点设置为位于文本的中心。 /// void Text::centerText() { m_text.setOrigin(m_text.getGlobalBounds().width / 2, m_text.getGlobalBounds().height / 2); } /// /// 将文本的字符串设置为参数 t_text。 /// /// 用于替换当前字符串的文本 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); } /// /// 调整文本的位置,使其与重叠的矩形对齐。 /// /// 需要对齐中心的矩形 void Text::AlignText(sf::RectangleShape t_button) { m_text.setPosition(t_button.getPosition().x, t_button.getPosition().y); }

完整内容
My Fishing World

My Fishing World

标签: 运动的
4.0
Android 4.4+
版本:1.15.109
55.2 MB

/// 用于设置文本对象的字体、大小、颜色、位置和文本的构造函数。 /// 要使用的文本字体 /// 要使用的文本字符串 /// 要使用的文本大小 /// 文本对象原点的 X 坐标 /// 文本对象原点的 Y 坐标 /// 文本对象的颜色 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() { } ///

/// 将文本的原点设置为位于文本的中心。 /// void Text::centerText() { m_text.setOrigin(m_text.getGlobalBounds().width / 2, m_text.getGlobalBounds().height / 2); } /// /// 将文本的字符串设置为参数 t_text。 /// /// 用于替换当前字符串的文本 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); } /// /// 调整文本的位置,使其与重叠的矩形对齐。 /// /// 需要对齐中心的矩形 void Text::AlignText(sf::RectangleShape t_button) { m_text.setPosition(t_button.getPosition().x, t_button.getPosition().y); }

完整内容
下载
最新版本 1.15.109
My Fishing World应用截图
发表评价
您的评论(*)
Copyright © 2024 godbu.com All rights reserved.