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

2012/1/10

can not find symbol/methods

craigv craigv

2012/1/10

#
some methods, like getHeight() can not be found, any ways to fix it/declare it? the way i'm using it when an issue comes up is: Actor under = getOneObjectAOffset (0, getHeight() / 2, muffin.class); error: cannot find symbol - method getHeight() any help would be cool
Builderboy2005 Builderboy2005

2012/1/10

#
Actors do not have a getHeight() method, but their images do, try getImage().getHeight() instead. If you grow tired of always referencing the image, you can always write your own method:
public int getHeight(){
    return getImage().getHeight();
}
craigv craigv

2012/1/10

#
awesome, thanks buddy. i was watching a tutorial on this topic (platform games) and had the same code, which in the tutorial, the code compiled with no errors. very strange! anyways, thanks!
You need to login to post a reply.