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

Author Topic: Having trouble making clickable menu buttons. Failing hard.  (Read 8382 times)

0 Members and 7 Guests are viewing this topic.

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Having trouble making clickable menu buttons. Failing hard.
« Reply #15 on: March 03, 2014, 12:31:56 am »
term does not evaluate to a function taking 1 arguments
Which term? Which function is being called?

IntelliSense: expression preceding parentheses of apparent call must have (pointer-to-) function type   
Which expression? Where in the code does this happen?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

stellarpie

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Having trouble making clickable menu buttons. Failing hard.
« Reply #16 on: March 03, 2014, 12:36:33 am »
term does not evaluate to a function taking 1 arguments
Which term? Which function is being called?

IntelliSense: expression preceding parentheses of apparent call must have (pointer-to-) function type   
Which expression? Where in the code does this happen?

Code: [Select]
//Inside of the Button Class's constructor function
                buttonSize = size;
rectShape.setSize(buttonSize);
rectShape.setFillColor(color);
rectShape.setPosition(position);
rectBoundingBox.left(20); //<----------------------------
rectBoundingBox.top(20);  //<------------------------------------

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Having trouble making clickable menu buttons. Failing hard.
« Reply #17 on: March 03, 2014, 12:43:59 am »
Try assignments.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

stellarpie

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Having trouble making clickable menu buttons. Failing hard.
« Reply #18 on: March 03, 2014, 12:47:23 am »
Try assignments.

I just tried that, and I think it's working. Could you explain why you have to assign some, and other's is like in parenthesis?
like for example
sf::RectangleShape myRectangleShape;
myRectangleShape.setFillColor(sf::Color::Blue); <---- parenthesis

sf::FloatRect myFloatRect;
myFloatRect.top = 20; <----- assignment

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Having trouble making clickable menu buttons. Failing hard.
« Reply #19 on: March 03, 2014, 01:27:43 am »
.setFillColor() is a method and takes parameters.
.left is a member and holds values.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

stellarpie

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Having trouble making clickable menu buttons. Failing hard.
« Reply #20 on: March 03, 2014, 01:32:10 am »
Okay sweet. I finally made working buttons. woot woot! :)
Thanks everyone!

G.

  • Hero Member
  • *****
  • Posts: 1592
    • View Profile
Re: Having trouble making clickable menu buttons. Failing hard.
« Reply #21 on: March 03, 2014, 01:40:35 am »
left and top are not functions  >:(

stellarpie

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Having trouble making clickable menu buttons. Failing hard.
« Reply #22 on: March 03, 2014, 02:01:58 am »
left and top are not functions  >:(
don't be mad bbz :c

 

anything