This site requires JavaScript, please enable it in your browser!
Greenfoot back
mendg025
mendg025 wrote ...

2015/4/10

Whenever I try to set the paint order, it keeps giving me <identifier>. What do I do?

mendg025 mendg025

2015/4/10

#
the code is... public void setPaintOrder(Hero.class Background.class);
danpost danpost

2015/4/10

#
Need context. Show the code for the class where you are trying to use this line (with the line in it as you tried it). Please see the link below the reply box on posting code before posting any code.
davmac davmac

2015/4/10

#
Whenever I try to set the paint order, it keeps giving me <identifier>.
That's not a complete error message.
the code is... public void setPaintOrder(Hero.class Background.class);
There should be a comma between the two parameters.
public void setPaintOrder(Hero.class, Background.class);
Super_Hippo Super_Hippo

2015/4/10

#
In the world class, there is a method called 'setPaintOrder'. To use it, you would use it like this:
setPaintOrder(Hero.class, Background.class);
So without the 'public void' and with a comma. If you want to create a method which you name 'setPaintOrder' for some reason and it has a Hero and a Background object as parameters, then it would look like this:
public void setPaintOrder(Hero h, Background b)
{
    //...
}
But since you have a semicolon after your line, I guess you just want to call that method, so remove the 'public void' and add a comma.
davmac davmac

2015/4/10

#
Super_Hippo wrote...
So without the 'public void' ...
Damn, I missed that.
You need to login to post a reply.