×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    13

    Howto do a MENU using Fullcanvas??

    Hi there i am making a game... so i used fullcanvas and only painted like 80% of the screen... so i wrote Menu on the left side of the other 20%...

    So how can i make a menu opening when i press a key that corresponds to the menu??


    I hope to be understandable


    Another thing... how do i unload all things in the game from the mobile memory?? And how to be sure of that??

    Best Regards
    Luis

  2. #2
    Regular Contributor
    Join Date
    Aug 2003
    Location
    Eire
    Posts
    182
    Take a look at the sticky thread at the top that may be your problem if i'm understanding your question.

    If you are Creating your own menu using FullCanvas then just use drawstring to draw your lable (i.e. select) over the softkey then listen for the softkeys button being pressed. (you can find what it is if you check the java docs that are in the Nokia folder if you have the Nokia Suite installed.)

    As for unloading things from memory set them equal to null.


    Code:
    Image ball = createimage("/image.png");
    
    //when you are finshed with the  image
    
    ball = null;
    
    System.gc(); // call garbage collector
    Brian

  3. #3
    Registered User
    Join Date
    Nov 2003
    Posts
    13
    OK I know that of the image.. it was not like that...

    Its like what should i insert in the DestroyApp?? and how do i use it??


    About the menu i use drawstring to draw a string over the button i want to use... but what i needed with this question was something like... ok i press the menu button and another window appears showing the menu options and pausing the game...

    Like the xp windows menu (START) effect was very cool


    Regards

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    About destroyApp(): you could set all your objects to null, but I don't think it's necesary. Since the MIDlet is destroyed there won't be any references to those objects anyway. What is important is that you don't leave any threads running in the background.

    And as for the popup menu: you'll have to do that yourself. When the user presses the menu button (probably one of the FullCanvas.KEY_SOFTKEYx constants), you set a boolean flag that pauses your main game thread, and also tells you to paint the menu (drawRect() or some image, and a bunch of drawString()s I imagine).

    shmoove

  5. #5
    Registered User
    Join Date
    Nov 2003
    Posts
    13
    Ok i am getting into it

    I was wondering if i can make the same effect as the START Menu of Windows... but instead of going up, i wanted like going right and up...

    Just another question for me to stop running a thread i just make null the thread var?? Or i have to do it another way???

    Thank you

    Regards
    Luis
    Last edited by djpirra; 2004-01-19 at 00:59.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×