Hello,
I'm playing with SFML to create animation for my project. I have an issue trying to increase very slowly alpha value of a sprite.
while (window.isOpen())
{
// Get elapsed time
float delta = clock.restart().asSeconds();
auto alpha_etoile = etoile2_sprite.getColor().a;
etoile2_sprite.setColor(sf::Color(255, 255, 255, (alpha_etoile + 1 * delta)));
}
it work like this (but it's not what want):
etoile2_sprite.setColor(sf::Color(255, 255, 255, (alpha_etoile + 1)));
I believe it's because alpha is an unsigned char. So when I add only decimal to its value it's cast an value doesn't change. So I can really use distance by second for alpha because it's integer value only. But maybe I'm missing something.
otherwise It works for sprite's scale, rotation and position (those are all float variables I believe)