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

Author Topic: rectSourceSprite out of scope  (Read 1599 times)

0 Members and 1 Guest are viewing this topic.

jerryd

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
rectSourceSprite out of scope
« on: August 09, 2020, 01:26:09 am »
SFML forum,

 I'm doing some sprite displaying in a function.
 I can do:
 sprite.setPosition(x,y);
 window.draw(sprite);

 but the compiler doesn't like:
 rectSourceSprite.left = 213;

 I have used all this command successfully outside of the function
 but the error message seems to indicate it's out of scope.

 I tried:
 sf::rectSourceSprite.left = 213;
 sprite.rectSourceSprite.left = 213;
 but they don't satisfy the compiler.

Any suggestions?
Jerry D


Rosme

  • Full Member
  • ***
  • Posts: 169
  • Proud member of the shoe club
    • View Profile
    • Code-Concept
Re: rectSourceSprite out of scope
« Reply #1 on: August 11, 2020, 05:19:32 pm »
What is rectSourceSprite? sf::Sprite does not have this member. And SFML does not have a class called rectSourceSprite either.

Either post the whole code (or at least minimal and reproducible), or make it clearer what you are trying to achieve. Why do you not want to use setPosition?
GitHub
Code Concept
Twitter
Rosme on IRC/Discord