SFML community forums

General => General discussions => Topic started by: snowboarder6009 on December 04, 2008, 06:50:59 am

Title: How Do You Do While Intersects
Post by: snowboarder6009 on December 04, 2008, 06:50:59 am
I have the following code which changes the color of EasternAustraliaSprite whenever the PointerRect intersects the EastAustRect.

what I want to do though is while the pointerRect intersects the EastAustRect change the color. How would i do this?

Code: [Select]

if(EasternAustraliaRect.Intersects(PointerBoxRect))
{
EasternAustraliaSprite.SetColor(sf::Color(0, 255, 0));
}
Title: Re: How Do You Do While Intersects
Post by: Wizzard on December 04, 2008, 08:52:51 am
Just put your code in your main loop.
Title: How Do You Do While Intersects
Post by: Core Xii on December 04, 2008, 10:13:15 am
To be perfectionist, you'd only want to do that when the conditions change (mouse moves)