This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Tiled Layers on MIDP 1.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Tiled Layers on MIDP 1.0" Watch "Tiled Layers on MIDP 1.0" New topic
Author

Tiled Layers on MIDP 1.0

bab javier
Ranch Hand

Joined: Aug 12, 2003
Posts: 32
Hi!
is there a way to make tiled layers in midp 1.0? also, is it possible to put two overlapping tiled layers on the screen?
thanks guys
David Price
Ranch Hand

Joined: Jan 22, 2003
Posts: 93
There's no way to get the MIDP implementation to draw the indexed tiles for you; instead, you'll need to either draw all the tiles yourself in a loop using drawImage, or more likely do that once to an offscreen Image and then draw that Image each time paint is called. I've used that trick successfully myself.
You can use this trick twice to have two overlapping tiled layers, however with standard MIDP 1.0 there's no way to make the offscreen Images transparent so the overlap may look wrong. On Nokia phones you can use the proprietary Nokia UI API, and call DirectUtils.createImage(width, height, 0) to get a transparent offscreen Image to draw into.
If you create two large offscreen 'tiled layer' Images, on some phones you may be pushing the limits of the available heap memory.
bab javier
Ranch Hand

Joined: Aug 12, 2003
Posts: 32
tnx david
urarom sogard
Greenhorn

Joined: Sep 10, 2002
Posts: 21
http://www.javagaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=J2ME;action=display;num=1053093860
Fred Grott
Ranch Hand

Joined: Oct 05, 2002
Posts: 346
Originally posted by bab javier:
Hi!
is there a way to make tiled layers in midp 1.0? also, is it possible to put two overlapping tiled layers on the screen?
thanks guys

depends upon what LWT or Lightwieght UI library you are using..
synclast UI allows you do tiling of background image in UI widgets..


MobileBytes blog - Sharing Technology - My Programming Knols
bab javier
Ranch Hand

Joined: Aug 12, 2003
Posts: 32
tnx guys! i finally got it
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Tiled Layers on MIDP 1.0
 
Similar Threads
MIDP 1.0 to MIDP 2.0 porting
Appliction error in Mobile Nokia 6020
OTA download of MIDlets
MIDP 1 on MIDP 2 devices
Bluetooth Development