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

Author Topic: sf::Sprite::setTextureRect': function does not take 2 arguments  (Read 1826 times)

0 Members and 1 Guest are viewing this topic.

AzkaIsHere

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
sf::Sprite::setTextureRect': function does not take 2 arguments
« on: January 30, 2018, 11:34:28 am »
help I just wrote this:

s1.setTextureRect(sf::IntRect(10, 10, 32, 32));

into my code and it says:

sf::Sprite::setTextureRect': function does not take 2 arguments.

could you tell me what it is about? on the tutorials the same exact command works.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10987
    • View Profile
    • development blog
    • Email
Re: sf::Sprite::setTextureRect': function does not take 2 arguments
« Reply #1 on: January 30, 2018, 11:52:23 am »
Sounds like you missed some bracket or added one too many. Check your syntax.
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: 25
    • View Profile
    • Email
Re: sf::Sprite::setTextureRect': function does not take 2 arguments
« Reply #2 on: January 30, 2018, 03:15:46 pm »
dude you don`t understand, the command is exactly the same of the sfml tutorials page. how can it be a syntax mistake

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: sf::Sprite::setTextureRect': function does not take 2 arguments
« Reply #3 on: February 03, 2018, 05:20:29 pm »
I think the suggestion was to check that the code you are trying to compile is identical to the code that you posted on the forum because everyone makes tpying errors. See? ;)

If, after checking that, it still doesn't work, can you post a complete and minimal example that still has the problem?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

dmitry_t

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: sf::Sprite::setTextureRect': function does not take 2 arguments
« Reply #4 on: February 13, 2018, 09:52:59 pm »
dude you don`t understand, the command is exactly the same of the sfml tutorials page. how can it be a syntax mistake
But the tutorial code differs a bit:
Quote
sprite.setTextureRect(sf::IntRect(10, 10, 32, 32));
There is no s1 variable there :)
Is it possible that you have more than one setTextureRect() call and the compiler points to some other line?

 

anything