java me - J2ME app menu develop -


I am developing a small j2me game and I want to make a menu for this application. I imagine the menu as the vertical list of items with the cursor on either the left or right side, that I can go to the item from the item, something like that but to get such effects as the main menu Should use? I only need advice or a link, I will develop it myself

Thanks in advance! Import java.util.Vector; Import javax.microedition.lcdui.Canvas; Import javax.microedition.lcdui.Font; Import javax.microedition.lcdui.Graphics; Import javax.microedition.lcdui.Image;

The plan you want is not possible to give more links because nobody Do not remember what can help on things like yours In fact, the most useful link for you might be the MIDP () API reference - your share is going to be mostly LCDI package, and especially Graphics API.

For advice, there is no problem. The first thing is that with the inherent list you will have more coding and more (too many) testing / debugging compared to your previous experiment. If you can think of some possible time-limits / time requirements that can be a problem - just keep in mind that the pre-design with the in-built list as a fallback. It does not look fancy, but it will work safely and correctly.

Another important thing is to decide which type of devices you want to target for the menus that you are going to develop, to see continuous and 160x200 native phones with a 400x600 touchscreen smartphone. But both of them can be difficult to realize. Below I'm assuming that you will try to target as many different types of devices as possible - note that you can compress it, this code will be easy to test and.

The device is helpful in using an emulator that can be configured to simulate the resolution, prege or absence of different display sizes and touchscreen input etc. Keep in mind that emulators alone will not completely emulate the real device. To keep your feets on the ground, consider your regular application with the actual device, better to use over-the-air (OTA) installation.

Here are some special API tips that I can think of now. Use Canvas.getGameAction to handle pressed key code - which is the most reliable / portable way to look up / down and select actions for the menu.

  • If the screen has touch screen support, then use Canvas.hasPointerEvents to detect users with touch screen devices may be disappointed if it detects that on the screen Your fancy menu can not react when you tap
  • Use Font.getHeight and Font.stringWidth to find out how much space has been captured by the menu item text.
  • If you want to do something on the image object, use Image.getGraphics .

    As I mentioned, you most likely have the LCDI A lot of things using graphics is mostly rather simple, but you will probably need to understand some hard stuff about clipping. Best wishes

  • Comments

    Popular posts from this blog

    mysql - BLOB/TEXT column 'value' used in key specification without a key length -

    c# - Using Vici cool Storage with monodroid -

    c# - Confused over DLL entry points (entry point not found exception) -