MCPcopy Create free account
hub / github.com/SFML/SFML / update

Method update

examples/keyboard/Keyboard.cpp:647–658  ·  view source on GitHub ↗

Fade out ouline

Source from the content-addressed store, hash-verified

645
646 // Fade out ouline
647 void update(sf::Time frameTime)
648 {
649 const float ratio = m_remaining / duration;
650 const float alpha = std::max(0.f, ratio * (2.f - ratio)) * 0.5f;
651
652 sf::Color color = getOutlineColor();
653 color.a = static_cast<std::uint8_t>(255 * alpha);
654 setOutlineColor(color);
655
656 if (m_remaining > sf::Time::Zero)
657 m_remaining -= frameTime;
658 }
659
660private:
661 static constexpr sf::Time duration = sf::milliseconds(150);

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected