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

Author Topic: Buttons moving with view  (Read 1838 times)

0 Members and 1 Guest are viewing this topic.

Fantasy

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Buttons moving with view
« 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?

julen26

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
    • http://julen26.blogspot.com
Buttons moving with view
« Reply #1 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
...

Fantasy

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Buttons moving with view
« Reply #2 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 :)

LucasShadow

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Buttons moving with view
« Reply #3 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.

 

anything