×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    5

    Seamless display switching in Nokia Series 60 phones

    Hi!
    I encountered an issue, that my boss couldn't accept.
    I write a game with much graphics (about 100 KB) and some sounds (about 6 KB). I don't use any of the standard menus - all is made with custom font, custom backgrounds, etc, drawn on GameCanvas with full screen set.
    My problem is that when I use display.setCurrent(), white screen appears for a fraction of a second, and then the requested screen appears.
    As far as I know, it doesn't happen on Nokia 7650, but annoys my boss on Nokia 6600. Such white screen flashes also appears on the blue Nokia emulator.

    Help!

    Michal

  2. #2
    Registered User
    Join Date
    Apr 2005
    Posts
    5
    No solution? Shmoove, Deepspace - you are The Experts. Don't you have any tip for me?

  3. #3
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,430
    Hi,

    All I understood from ur posting is that U r developing a canvas based app;
    I could not understand why u r using display.setCurrent() multiple times.
    IMHO U need only one canvas to do all the operations;
    Even if u r using multiple classes; draw every thing in a main canvas;So that I suppose ur problem will be solved.

    Hope this helps!

    regards
    Gopal

    PS: plz dont post same thread at multiple sections....It may lead to confusions...

  4. #4
    Registered User
    Join Date
    Apr 2005
    Posts
    5
    You mean create the canvas, put all game's painting (menus, intro, highscore, level selection, etc.) in one paint method, and switch the painting and reactons for key presses from other classes?
    Or just to paint in the graphics context, taken from this one canvas?
    The latter would be easier, because the game is almost finished, but what about user input then?

  5. #5
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    It's better if you have different drawing methods for each state, and in paint you have a switch that calls the right method depending on the state of your game.

    shmoove

  6. #6
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,430
    Hi,

    Since ur game is almost over the second method would be better;
    otherwise the first method u said is more advisable...

    Here is some sample piece of code..

    public void paint(Graphics g)
    {
    switch(status)
    {
    case SPLASH_SCREEN:
    //Display Splash
    SplashScreen.drawSplash(g);
    break;

    case MAIN_MENU:
    //Display main menu
    MainMenu.drawMenu(g);
    break;

    case GAME:
    //Game
    MyGame.drawGame(g);
    break;
    }
    }


    For user input U could use Forms.....

    Hope this helps..

    regards
    Gopal

  7. #7
    Registered User
    Join Date
    Apr 2005
    Posts
    5
    I think, I'll mix both methods, because switch in the paint method will slow down the repainting.
    Thanks a lot!

  8. #8
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,430
    >>because switch in the paint method will slow down the repainting.

    I have been using this method for some of my game projects and I never noticed any slow down in the repainting......

    regards
    Gopal

  9. #9
    Registered User
    Join Date
    Apr 2005
    Posts
    39
    As it is mentioned in the thread, when switching canvases there is a problem, system screen (with antenna gauge etc) came up and is overwritten with the new canvas. Is it a problem of OS or JRE or is it just wrong programming practice ?

    MB

Posting Permissions

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