SFML community forums

Help => Graphics => Topic started by: natchos on October 15, 2012, 11:33:01 am

Title: Using an untextured or filled shape
Post by: natchos on October 15, 2012, 11:33:01 am
Is there any way to, instead of using sf::texture object to create and use a sf::shape, to simply fill the shape with a specified colour and then drawing it to the screen.

Alternatively can you fill a texture object with a single colour instead of loading an image?
Title: Re: Using an untextured or filled shape
Post by: eXpl0it3r on October 15, 2012, 11:47:48 am
Yes that's actually the main purpose of a sf::Shape... ;)
If you use textures you might want to check out sf::Sprite.

To fill a sf::Shape (sf::RectangleShape, sf::CircleShape) just call setFillColor().