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

2013/5/28

NullPointerException with setPaintOrder()?

For some reason I get a NullPointerException when I try to use my world. The error comes from this line of code:
setPaintOrder(HUD.class, LightActor.class, Ground.class, UseableActor.class, Background.class);
I've double checked, and all those classes do in fact exist in my program. I got the error when I added HUD. I think this may be because it's an interface, and not an actor. Would that assumption be correct?
bourne bourne

2013/5/28

#
Just tried it. Guess you can't use interfaces here. Abstract classes should work though.
Well a I already know abstracts work, LightActor and UseableActor are abstract. I wished interfaces would work. I don't want an empty abstract class that any HUD items need to extend, especially since a couple of the HUD implemented classes extend other objects...
You need to login to post a reply.