| Reply | « Previous Thread | Next Thread » |
|
How can I create an epilog in the start of a program and main menu after the demo(epilog in the start of the program) ?
please give me an example like loading on startup of the program an image png, then load a graphical main menu, like a background image and options that you can select. |
|
|
|
thanks alot for your help !! :))))
|
|
Join Date: Dec 2005
Posts: 1,696
Location: Europe/Poland/Warsaw
Offline
Super Contributor
|
|
@shmoove
excellent link, thanks too! |
| peterblazejewicz |
| View Public Profile |
| Find all posts by peterblazejewicz |
|
Well i don't want to make a game, but this tutorial is very helpful. My problem is that i don;t know if i had started in the right way. I would like a splash screen on the start of the program and then load the main menu. Any ideas?
Here is my code: =============================================== import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class LoadScreen extends MIDlet { private Display display; private MyCanvas canvas; public LoadScreen () { display = Display.getDisplay(this); canvas = new MyCanvas (this); } protected void startApp() { display.setCurrent( canvas ); } protected void pauseApp() { } protected void destroyApp( boolean unconditional ) { } public void exitMIDlet() { destroyApp(true); notifyDestroyed(); } class MyCanvas extends Canvas implements CommandListener { private Command exit; private LoadScreen LoadScreen; private Image image = null; public MyCanvas (LoadScreen LoadScreen) { this. LoadScreen = LoadScreen; exit = new Command("Exit", Command.EXIT, 1); addCommand(exit); setCommandListener(this); try { image = Image.createImage("/Screen.png"); } catch (Exception error) { Alert alert = new Alert("Failure", "Can't open image file.", null, null); alert.setTimeout(Alert.FOREVER); display.setCurrent(alert); } } protected void paint(Graphics graphics) { if (image != null) { graphics.drawImage(image, 0, 0, Graphics.LEFT | Graphics.TOP); } } public void commandAction(Command command, Displayable display) { if (command == exit) { LoadScreen.exitMIDlet(); } } } } =============================================== Please help me |
|
Join Date: Dec 2005
Posts: 1,696
Location: Europe/Poland/Warsaw
Offline
Super Contributor
|
|
|
| peterblazejewicz |
| View Public Profile |
| Find all posts by peterblazejewicz |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|