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.