×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    May 2003
    Posts
    151

    Changing display from canvas to form

    During my game I want to change from rendering the game to display some text which I've done in a form.

    How do I make sure that the screen has been cleared of all the game graphics ? If I was changing to another canvas I'd just call canvas.repaint but there doesn't seem to be a similar function for forms or lists ....


    tia

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Helsinki.FI
    Posts
    112
    Hi,

    it's just as simple as calling YOUR_DISPLAY.setCurrent(YOUR_FORM); and the VM renders the Form (or whichever Screen based displayable you are using) contents on the screen. With Canvas, only calling repaint() makes VM call the Canvas' paint() method and but with Screen based displayables you don't really need to worry with issues like that.

    Kind regards,
    Tinke / FN

  3. #3
    Regular Contributor
    Join Date
    Apr 2003
    Posts
    184
    Why don't you use the drawString method of the Graphics class?

  4. #4
    Regular Contributor
    Join Date
    May 2003
    Posts
    151
    >Why don't you use the drawString method of the Graphics class?

    Because it's quite a lot of text and I don't want to have to handroll my own scolling and formatting code.

  5. #5
    Regular Contributor
    Join Date
    May 2003
    Posts
    151
    Thanks Tinke - You're right, just setting the for to be current works.

    I was being dumb and still calling the canvas.repaint() and canvas.serviceRepaints() which caused the corruption.

    thanks
    dan

  6. #6
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Helsinki.FI
    Posts
    112
    zivgr,

    showing text on Canvas is out of the question if your Canvas activity is very time sensitive as drawString method is hideously slow.

    Kind regards
    Tinke / FN

Posting Permissions

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