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

Author Topic: Is it possible to disable Sprite auto re-size?  (Read 1457 times)

0 Members and 1 Guest are viewing this topic.

lfnunley

  • Newbie
  • *
  • Posts: 12
    • View Profile
Is it possible to disable Sprite auto re-size?
« on: March 27, 2013, 08:14:46 pm »
Hello all! I am wondering if it is possible to disable the auto re-sizing of sprites upon window re-size? On a related note, would it be possible to a sprite to preserve its apparent size while using a graphics window? For instance, like how on Google maps even though you may zoom in, location markers maintain their size.

I am planning on doing a project similar to Google maps, but for one area and interactive, so that's the nature of my question. Thanks for your replies in advance!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Is it possible to disable Sprite auto re-size?
« Reply #1 on: March 27, 2013, 08:51:12 pm »
Quote
Hello all! I am wondering if it is possible to disable the auto re-sizing of sprites upon window re-size?
It's not the sprite which is resized, it's the view which is not resized. What you want to do is to catch Resize events, and adjust the active view to the new size of the window.

Quote
On a related note, would it be possible to a sprite to preserve its apparent size while using a graphics window?
If you use a view which is managed as described above, the sprites drawn in it will always have the same size.
Laurent Gomila - SFML developer

lfnunley

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Is it possible to disable Sprite auto re-size?
« Reply #2 on: March 27, 2013, 11:14:12 pm »
Okay, thank you very much.

 

anything