Midlet Display with GameCanvas and Form

Hello, is there a way to have a GameCanvas and a Form on the same midlet display? I tried using setLayout and a BorderLayout but those seam to not be suported in J2ME.

What I want is to show a game screen (not animated) on top and a input box (textfield) on bottom so the user can play while he sees the game screen.

How can it be done?

Thanks for your comments.

Message was edited by:

ZeroOneZeroOneOne

[441 byte] By [ZeroOneZeroOneOnea] at [2007-11-27 10:37:26]
# 1

You need to use a CustomItem for text input on the Canvas.

Alternatively if the image for your game has only a few modes to display, tou could use a form and change the image at runtime.

Regards, Darryl

Darryl.Burkea at 2007-7-28 18:48:06 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

Hello and thanks for your comment.

[quote]

Alternatively if the image for your game has only a few modes to display, tou could use a form and change the image at runtime.

[/quote]

Its not exactly an Image. It's a set of lines and drawStrings done in the Graphics of the Canvas / GameCanvas.

Can that be saved to an image and then loaded in the form? How?

Thanks.

Message was edited by:

ZeroOneZeroOneOne

ZeroOneZeroOneOnea at 2007-7-28 18:48:06 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3

Image img=Image.createImage(width,height);

Graphics g=img.getGraphics();

Zangaza at 2007-7-28 18:48:06 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4

Thanks that works.

Just another question, I did that and appended the image to the form.

Now the thing is that the image appears with a border. And the screen loses about 1 pixel per side (space between the image border and the screen border). Can this space be eliminated?

Thanks.

ZeroOneZeroOneOnea at 2007-7-28 18:48:06 > top of Java-index,Java Mobility Forums,Java ME Technologies...