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

Author Topic: Setting a sprites image  (Read 2720 times)

0 Members and 1 Guest are viewing this topic.

Kwang1imsa

  • Newbie
  • *
  • Posts: 26
    • MSN Messenger - kwang1imsa@gmail.com
    • View Profile
Setting a sprites image
« on: June 12, 2011, 04:41:34 am »
When i set sprite.image = new image('path');, things break for me.  The image is scaled wrongly, it is cropped, and things don't work out right.  I set my sprite width, height, and scale up to that of the image's and turn smoothing off, but it still breaks.  What am I supposed to do?

This is an existing sprite with its image being reset to a different one.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Setting a sprites image
« Reply #1 on: June 12, 2011, 09:55:57 am »
You must adjust the SubRect to the size of the new image.
Laurent Gomila - SFML developer

 

anything