SFML community forums

Help => Graphics => Topic started by: John doe on December 02, 2019, 11:45:42 pm

Title: Sprite fit the Whole Window
Post by: John doe on December 02, 2019, 11:45:42 pm
Hey everyone,
I know that my question may seem so stupid, but I just began learning SFML and don't know much here. I was wondering how can I make my sprite fit the screen. I don't mean if I resized because I've seen so many posts on this. I mean normally when I set a sprite how to make it stretched out to fit the whole window no matter what their sizes are
Please any help
Thank you
Title: Re: Sprite fit the Whole Window
Post by: G. on December 03, 2019, 04:01:31 pm
Make a view the same size as the sprite. Or scale the sprite.
Title: Re: Sprite fit the Whole Window
Post by: Hapax on December 03, 2019, 05:06:56 pm
Just to be clear, you can scale the sprite in-code using sprite.setScale() so you wouldn't - in this case - need to externally scale the original image.

You could also just use a sf::RectangleShape and give it the texture you want. Then, you can give the rectangle any size you want; it isn't locked to the texture rectangle in the same way that a sprite is.