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

Author Topic: [SFML 2.0 RC] probably a bug - Sprite::setPosition  (Read 2274 times)

0 Members and 1 Guest are viewing this topic.

Prox

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
[SFML 2.0 RC] probably a bug - Sprite::setPosition
« on: May 20, 2012, 09:30:52 am »
Hi everyone,
Yesterday, I've been started moving my project to SFML 2.0 RC  and I found big issue for me. When I want to change a position with combination Sprite::getPosition() and Sprite::getSetPosition(float, float), the sprite changes the scale, but if i use Sprite::move(float, float) there is no issue with scale. Any suggestions?

Prox

PS: I use Mac os x 10.7.4

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [SFML 2.0 RC] probably a bug - Sprite::setPosition
« Reply #1 on: May 20, 2012, 09:34:42 am »
Can you show your code?
Laurent Gomila - SFML developer

Prox

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: [SFML 2.0 RC] probably a bug - Sprite::setPosition
« Reply #2 on: May 20, 2012, 09:41:56 am »
The code
float move = delta*speed;
int y = 0;
for(it=grid.begin(); it != grid.end(); it++){
        y = (*it)->sprite.getPosition().y;
        (*it)->sprite.setPosition(0, y+move);
        //y = (*it)->sprite.getPosition().y;
        //(*it)->sprite.move(0, move);

}
 

EDIT: I can share a Mac bundle if need.
« Last Edit: May 20, 2012, 09:53:19 am by Prox »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [SFML 2.0 RC] probably a bug - Sprite::setPosition
« Reply #3 on: May 20, 2012, 10:15:48 am »
I can tell you for sure that it's not a bug in SFML (move internally calls setPosition).

There's probably a problem in your code, but it's hard to find which one with a small part of a bigger code.

Could you write a complete and minimal program that reproduces the problem?
Laurent Gomila - SFML developer

Prox

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: [SFML 2.0 RC] probably a bug - Sprite::setPosition
« Reply #4 on: May 20, 2012, 10:21:04 am »
I've just sent a PM to you with link to source code.

Prox

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Laurent Gomila - SFML developer

Prox

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: [SFML 2.0 RC] probably a bug - Sprite::setPosition
« Reply #6 on: May 20, 2012, 10:34:12 am »
Sorry, understood.

Prox

PS: I'll update this post when I create a sample.