Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Sprite scaling/resize relativity issue  (Read 2266 times)

0 Members and 1 Guest are viewing this topic.

Joshua Flynn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Sprite scaling/resize relativity issue
« 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.

Joshua Flynn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Sprite scaling/resize relativity issue
« Reply #1 on: May 23, 2011, 01:23:40 am »
Any offers of help?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Sprite scaling/resize relativity issue
« Reply #2 on: May 23, 2011, 01:49:14 am »
One hour is certainly too early to push your post, especially at this time :roll:
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Joshua Flynn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Sprite scaling/resize relativity issue
« Reply #3 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Sprite scaling/resize relativity issue
« Reply #4 on: May 23, 2011, 02:11:05 pm »
SetScale and Resize are absolute.
Scale is relative to previous scale factors.
Laurent Gomila - SFML developer

Joshua Flynn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Sprite scaling/resize relativity issue
« Reply #5 on: May 23, 2011, 02:19:08 pm »
Alright. Resize for some reason, acted relative. I'll try SetScale.

Thank you!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Sprite scaling/resize relativity issue
« Reply #6 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?
Laurent Gomila - SFML developer