| Author |
is their any way to get the list in the middle of the screen whit out filling the screen or overwrit
|
Anton Sigurddon
Greenhorn
Joined: Sep 29, 2011
Posts: 1
|
|
hi.
i got this code this is the draw stuff. its works great bat when i wont to use the list. like new game and load and exit, the are command i mad. it fills the screen. and the list is up in the upper left corner. and its overwrites the display filling the screen whit the list.
what i wont the list to do is to by in the middle of the screen on top of the draw stuff.
Image backGround= Image.createImage("/MenuImage.png");
g.drawImage(backGround, 0, 0, Graphics.TOP | Graphics.LEFT);
i do no this menu overwrites canvas
display.setCurrent(canvas);
display.setCurrent(menu);
is their any way to get the list in the middle of the screen whit out filling the screen or overwrite the nice background using the drawImage in canvas?
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 12513
|
|
Welcome to the JavaRanch, Anton!
Screen layout can be tricky, especially if you're trying to create a general-use program where people can be using devices whose screens are many different sizes and shapes.
For basic control layout, usually there's a layout manager that you can instruct on how to align components (left/right/center, top/middle/bottom).
If you're doing custom controls inside a Canvas, you'll have to do the work yourself. The center point is, of course w/2, h/2, where w and h are width and height of the Canvas object that you want to center the graphics in. And the top/left corner of the control would then be w/2 - bw/2, h/2 - bh/2, where "bw" and "bh" are the box width and box height of the control itself.
|
One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 7602
|
|
Frankly speaking the UI and controls offered by basic MIDP is very basic, to put it in a nice way.
For more control over component placements, layouts and a richer user experience, I would recommend using something like LWUIT
|
[Donate a pint, save a life!] [How to ask questions]
|
 |
 |
|
|
subject: is their any way to get the list in the middle of the screen whit out filling the screen or overwrit
|
|
|