我目前正在C++中用SFML創建一個標誌序列,並且想輸入一個所需的時間然後淡出這段時間,比如說,如果輸入是3,則淡出該顏色,直到3秒鐘結束。顏色整數的最大值,作爲一個顏色在255處爲白色。這是我目前的代碼:試圖找出一個方程來褪色一段時間的顏色
sf::Time fadeCalc = clock.getElapsedTime();
int f = fadeCalc.asMilliseconds();
int l = logoLength.asSeconds();
int iColor = "Equation needed using variables"
sf::Color fadeColor(iColor,iColor,iColor);
Fade.setFillColor(fadeColor);
任何幫助將不勝感激!對不起,我找不出解決問題的方法。
非常感謝!這是一個完美的答案,我無法把頭圍住它。 – John 2013-02-23 20:28:18