SFML community forums

Help => Graphics => Topic started by: Joshua Flynn on May 23, 2011, 12:18:10 am

Title: Sprite scaling/resize relativity issue
Post by: Joshua Flynn on May 23, 2011, 12:18:10 am
Hello,

I've got a window of a specific size (512 x 512), and any images whose height is lower than this (256) or greater than this (1024, 2048), have their sprite rescaled to match the 512 requirement.

The problem is, I find the scale/resize system relative rather than absolute, so, for example:

If I load an image that is 256 to sprite, and resize/scale sprite to fit 512, and then I reload another image (also 256), and then resize/rescale sprite - instead of sprite still being 512, sprite becomes 1024, 2048 etc etc.

How do I make it so the scaling of sprite is reset to normal?

Thank you.
Title: Sprite scaling/resize relativity issue
Post by: Joshua Flynn on May 23, 2011, 01:23:40 am
Any offers of help?
Title: Sprite scaling/resize relativity issue
Post by: Nexus on May 23, 2011, 01:49:14 am
One hour is certainly too early to push your post, especially at this time :roll:
Title: Sprite scaling/resize relativity issue
Post by: Joshua Flynn on May 23, 2011, 02:06:28 pm
Quote from: "Nexus"
One hour is certainly too early to push your post, especially at this time :roll:


Well, let's try 1pm then. I am a programmer after all.
Title: Sprite scaling/resize relativity issue
Post by: Laurent on May 23, 2011, 02:11:05 pm
SetScale and Resize are absolute.
Scale is relative to previous scale factors.
Title: Sprite scaling/resize relativity issue
Post by: Joshua Flynn on May 23, 2011, 02:19:08 pm
Alright. Resize for some reason, acted relative. I'll try SetScale.

Thank you!
Title: Sprite scaling/resize relativity issue
Post by: Laurent on May 23, 2011, 02:33:45 pm
Quote
Alright. Resize for some reason, acted relative.

It would be a bug. Can you please provide a minimal and complete example that reproduces this problem?