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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sfml4Gamedev

Pages: [1]
1
General / Re: Error expected a member name
« on: November 02, 2016, 08:04:04 pm »
I fixed this, I needed to call the objects function using -> since it's a pointer

ex)
   this->getSprite()->getGlobalBounds().contains(mousePos);

2
General / Error expected a member name
« on: November 02, 2016, 06:17:43 pm »
void Button::checkClick(sf::Vector2f mousePos) {
   this->&getSprite().getGlobalBounds().contains(mousePos); /*error here I can't deference the pointer to my sprite to call this function*/
}

//currentSpr is a pointer to the current sprite being used by my button
sf::Sprite* Button::getSprite() {
   return currentSpr;
}

My question is how can I implement my check click function / how can I fix this error

Pages: [1]