Hi, I’m really stuck here and any help is much appreciated! With the recently released MIDP2 I’ve created a layerManager and appended a sprite to it. But I can’t manage to display the sprite. This is the code:
..
Image theImage;
Sprite theSprite;..
void someMethod() {
try {
LayerManager lm = new LayerManager();
theImage = Image.createImage("/images/someImage.png");
theSprite = new Sprite(theImage, (theImage.getWidth()/2), (theImage.getHeight()/2));
lm.append( theSprite ); lm.setViewWindow( 0, 0, 96, 100 );
theSprite.paint (graphicObject);
} catch (java.io.IOException ex) {
}
}
In this code-snippet, what should the graphicObject be onto which the sprite is to be painted? Any examples?
I also tried creating a public class “TheSprite” extending Sprite and defining a method paint() in it. But the paint-method of Sprite cannot be overrided and a constructor cannot be resolved.
Please help!