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

Author Topic: put the player at the center of the view from another class  (Read 952 times)

0 Members and 1 Guest are viewing this topic.

AzkaIsHere

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
put the player at the center of the view from another class
« on: April 18, 2018, 08:43:55 pm »
hello guys I am struggling with this error:

no instance of overloaded function "sf::View::setCenter" matches the argument list

that comes when I do this:


   void playerposition()
   {
      player.getPosition();
   }

from my player class and then in the main function I write this:

Player p1;

p1.playerposition();

anyone can explain why the error?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10852
    • View Profile
    • development blog
    • Email
Re: put the player at the center of the view from another class
« Reply #1 on: April 19, 2018, 08:11:57 am »
Your posted code doesn't use setCenter so how should we know? ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

AzkaIsHere

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Re: put the player at the center of the view from another class
« Reply #2 on: April 19, 2018, 10:51:41 am »
sorry I didn't write it but anyway I fixed the error so it's ok :D

 

anything