SFML community forums

Help => Graphics => Topic started by: esotericsean on January 23, 2011, 09:47:38 pm

Title: Sprite Incorrect Size?
Post by: esotericsean on January 23, 2011, 09:47:38 pm
Hey guys,

Just learning SFML, have a question about how to load a sprite.

Actually, I can load the image just fine and display it. But it seems like it's making the image slightly smaller (resampling it) when it displays it:

(http://gyazo.com/0da8e52ecb6409e8bd2cc49673d4848b.png)

Do I need to set the scale of a sprite when I load it? Here's what my code looks like:

(http://gyazo.com/65760a017a69d94baf9ad1cc56495204.png)

Thanks!
Title: Sprite Incorrect Size?
Post by: Laurent on January 23, 2011, 09:49:10 pm
No they are not scaled. Maybe you're confused by the smooth filter. Try calling image.SetSmooth(false).
Title: Sprite Incorrect Size?
Post by: esotericsean on January 23, 2011, 09:57:36 pm
Ah, success! Thank you very much! :)

(http://gyazo.com/337e1cf41595f6782aa156cc6f768af9.png)