×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    12

    How to call one canvas from another canvas

    Dear Friends,

    I m trying to develop an application using the low-level gui (i.e. Using canvas)...

    I have implemented some buttons on it...

    Now i want to call one Canvas from another canvas when control goes to particular button on canvas...

    Is it possible...if yes then anybody pls tell me how to do that?
    If no then pls suggest me other ways...

    Thanks,
    Ajit

  2. #2
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: How to call one canvas from another canvas

    If you want to display another canvas, you have to use setCurrent(Displayable nextDisplayable).
    A Displayable is made visible by calling the setCurrent() method of Display. When a Displayable is made current, it replaces the previous Displayable.

    Regards
    Gopal

    __________________
    MobiQuil.com
    An initiative by Developers for Developers.
    http://www.mobiquil.com - Alpha - Launched.

  3. #3
    Registered User
    Join Date
    Oct 2006
    Location
    Jakarta, Indonesia
    Posts
    5

    Re: How to call one canvas from another canvas

    Shouldn't there be only one Canvas for each MIDlet? For performance reason, shouldn't we have different images drawn on the same canvas to display different states(information) within a single application?

    I'm new to j2me game development and is very confused. I decompile various j2me games and sees that there's only one Canvas with tens/hundreds of thousands of lines of code. Please help me with what approach should I take?

    Thanks in advance!

  4. #4
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: How to call one canvas from another canvas

    IMHO, it would be preferable to use one Canvas in games.

    Regards
    Gopal

    __________________
    MobiQuil.com
    An initiative by Developers for Developers.
    http://www.mobiquil.com - Alpha - Launched.

  5. #5
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    307

    Re: How to call one canvas from another canvas

    Actually it is much simpler and better to have one Canvas in your application, and redraw its contents (menus, buttons, etc.) according to the state changes (pressed keys, selected options, etc.) If for a moment you need to show a totally another contents (like "The best scores"), then you can also use different classes, where each of the class will draw its own content on the provided Graphcis object, and will return control to the main class after pressing "OK" or "Back" button.

  6. #6
    Registered User
    Join Date
    Feb 2007
    Posts
    1

    Re: How to call one canvas from another canvas

    Hi everyone!

    I am having a similar issues to the one stated above. Basically I am loading a midlet up which calls a Splash screen which then moves onto a GUI menu which is in another class. The GUI menu is a extension of the game canvas.

    On my menu I have some options, just simple images, when I use the up or down button a rectangle highlights the current option. When I hit the FIRE button I want to enter my game, which is in another file, which is again a extension of a GameCanvas.

    I am having real difficult in moving between these two canvasses!

    Any extra help?

Similar Threads

  1. Error while accepting an incoming call
    By yogesh14 in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2006-03-23, 03:55
  2. SX1 dialling initiates fax call instead of voice call
    By kdinn in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2005-08-25, 06:12
  3. Rapid call icon on 6630 Canvas
    By manupeco in forum Mobile Java General
    Replies: 0
    Last Post: 2005-02-18, 13:48
  4. i got Exception when i call the high level screen from the canvas screen using comman
    By madnan_java in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2004-10-05, 13:50
  5. Major problem with delegation to Canvas
    By bartekn in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2003-10-08, 17:46

Posting Permissions

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