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

Author Topic: Sf::View and How can i fix things on display?  (Read 809 times)

0 Members and 1 Guest are viewing this topic.

Jan666

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Sf::View and How can i fix things on display?
« on: May 22, 2022, 08:06:09 am »
Hi,
I try to make 2d sidescroller with Touch on mobilephone. I used sf::View to follow my Player, and it works. But i have also 3 Buttons on display they move away. How can i fix them on display?

G.

  • Hero Member
  • *****
  • Posts: 1592
    • View Profile
Re: Sf::View and How can i fix things on display?
« Reply #1 on: May 22, 2022, 10:03:07 am »
Draw them on another view that doesn't move.
window.setView(scrollableView);
// draw your gameplay here
window.setView(fixedView);
// draw your user interface here

Jan666

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Sf::View and How can i fix things on display?
« Reply #2 on: May 22, 2022, 09:23:21 pm »
Thanks do your answer. Is there any parenting function between player and playercam(view)? When my player stop at a wall the  playercam dont!

 

anything