I have ui objects that allow me to overwrite their tick methods and I want to call other methods in these tick methods. But the way I'm doing it, the objects haven't been initialised yet so it's not working. Here's an example:
//FPS
UITextRectangle fps = new UITextRectangle(
handler, handler.getWidth()-64, 32, 32, 32, Color.DARK_GRAY, Color.GRAY,
new Ticker(){
@Override
public void doTick(){
//cannot call fps
fps.setText(Integer.toString(handler.getFPS()));
}
});
How can I make this work? Any and all help and advice is appreciated!
Edited because my code was wrong.