Discussion Board

Results 1 to 3 of 3

Thread: canvas size

  1. #1
    Registered User
    Join Date
    Mar 2003

    canvas size

    Does anybody know what the 7650 Nokia phone
    canvas size will be when setting it to the Display.getCurrent().
    The display itself is 176 by 208 pixels. But
    what dimension is given to the canvas object.
    Is this about 176 by 188 pixels or ?????
    This to have an estimate for the size of splash screens.

  2. #2
    Regular Contributor
    Join Date
    Mar 2003

    RE: canvas size

    If you inherit from FullCanvas in the Nokia UI, you can use the full screen size of 176(width)x208(height).

    If you inherit from Canvas in javax.microedition.lcdui, the size is 176(width)x144(height).


    iomo ltd.

  3. #3
    Registered User
    Join Date
    Mar 2003

    RE: canvas size

    As Steve said, you need to use the Nokia specific FullCanvas to get the full screen to yourself, but then you can't use Command's and your application will only run on Nokia phones.

    I myself did in my current game two canvas classes: GameScreenBasic that subclasses Canvas and GameScreenFull that subclasses FullCanvas. Both have reference to a Game object that is the actual game logic and redirect calls to paint(), keyPressed() and keyReleased() to the Game object.

    In addition I have a static factory method that first tries to create Nokia specific GameScreenFull and if that can't be done creates the normal GameScreenBasic. You can check the Nokia supplied midletNokiaUI example BlockGame to see how to implement this kind of factory method (the example uses it to create NokiaGameEffects class when possible).

    This way your game will work ok on all MIDP devices, but will be at it's best on Nokia devices.

Posting Permissions

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