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

Author Topic: Sprite->setScale() problem  (Read 856 times)

0 Members and 1 Guest are viewing this topic.

jeres

  • Newbie
  • *
  • Posts: 2
    • View Profile
Sprite->setScale() problem
« on: February 19, 2013, 04:08:14 pm »
Hi!

I wanted to keep sprite fullscreen by manipulating its scale. Well, it was working only on original window size. If window size is lower than original window size, then sprite size is lower than window size. If window size is greater than original, then sprite is greater than window. It looks like this http://oi45.tinypic.com/2ck3n4.jpg - window was 800x600 and I decreased its size.

Here's my code: http://pastebin.com/hPPwSp1w, and here's image I want to rescale http://oi50.tinypic.com/ketd04.jpg.

I'm using newest SFML, right from repo.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Sprite->setScale() problem
« Reply #1 on: February 19, 2013, 04:20:18 pm »
Don't scale the sprite, what you want is the default behaviour. Everything is stretched when the window is resized because the view (sf::View) doesn't change.
Laurent Gomila - SFML developer

jeres

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Sprite->setScale() problem
« Reply #2 on: February 19, 2013, 04:47:06 pm »
I see. Thanks.

 

anything