SFML community forums

Help => Graphics => Topic started by: Fantasy on January 05, 2012, 10:46:28 am

Title: Buttons moving with view
Post by: Fantasy on January 05, 2012, 10:46:28 am
Hello guys
I have a sprite called button and my player sprite.
now i have a problem where the button sprite is moving with the screen. How can i only move the screen without moving the button sprite?
Title: Buttons moving with view
Post by: julen26 on January 05, 2012, 11:50:41 am
Draw the button on the default view:
Code: [Select]

...
set your view
draw player
reset default view //  window.SetView(window.GetDefaultView())  //
draw button
...
Title: Buttons moving with view
Post by: Fantasy on January 05, 2012, 02:30:32 pm
Quote from: "julen26"
Draw the button on the default view:
Code: [Select]

...
set your view
draw player
reset default view //  window.SetView(window.GetDefaultView())  //
draw button
...


thank you very much that works :)
Title: Buttons moving with view
Post by: LucasShadow on January 05, 2012, 04:47:13 pm
For SFML 1.6:

Code: [Select]

App.SetView(App.GetDefaultView())


Place that before your button is drawn and after your player is drawn.