Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tiled Layers on MIDP 1.0

 
bab javier
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tnx david
 
Fred Grott
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
bab javier
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tnx guys! i finally got it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic