SFML community forums

Help => Graphics => Topic started by: Bones on January 17, 2012, 04:19:18 am

Title: Setting a view's position?
Post by: Bones on January 17, 2012, 04:19:18 am
Is there a way that I could change a view's position without using .Move()?  I'd like to directly just set the position(in world coordinates) if that's possible.  Perhaps I'm missing some obvious reason why this can't be done though.

Thanks.
Title: Re: Setting a view's position?
Post by: coolhome on January 17, 2012, 05:15:09 am
Correct me if I'm wrong here, but would SetCenter work to change the positon? I've never used sf::View yet but looking at the sf::View source this is how the Move method operates.

Code: [Select]

void View::Move(float offsetX, float offsetY)
{
    SetCenter(myCenter.x + offsetX, myCenter.y + offsetY);
}
Title: Setting a view's position?
Post by: Bones on January 17, 2012, 05:26:04 am
Hey thanks, I'll try that!

EDIT: Tested, it works just as intended.