SFML community forums

Help => Graphics => Topic started by: Prox on May 20, 2012, 09:30:52 am

Title: [SFML 2.0 RC] probably a bug - Sprite::setPosition
Post by: Prox 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
Title: Re: [SFML 2.0 RC] probably a bug - Sprite::setPosition
Post by: Laurent on May 20, 2012, 09:34:42 am
Can you show your code?
Title: Re: [SFML 2.0 RC] probably a bug - Sprite::setPosition
Post by: Prox 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.
Title: Re: [SFML 2.0 RC] probably a bug - Sprite::setPosition
Post by: Laurent 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?
Title: Re: [SFML 2.0 RC] probably a bug - Sprite::setPosition
Post by: Prox on May 20, 2012, 10:21:04 am
I've just sent a PM to you with link to source code.

Prox
Title: Re: [SFML 2.0 RC] probably a bug - Sprite::setPosition
Post by: Laurent on May 20, 2012, 10:28:15 am
Please read this carefully:
http://en.sfml-dev.org/forums/index.php?topic=5559.msg36368#msg36368
Title: Re: [SFML 2.0 RC] probably a bug - Sprite::setPosition
Post by: Prox on May 20, 2012, 10:34:12 am
Sorry, understood.

Prox

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