Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Tiled Layers on MIDP 1.0  RSS feed

 
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
 
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
 
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!