Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User ieising's Avatar
    Join Date
    Dec 2004
    Posts
    23
    Hi,

    I'm working on a game and am now at a point where it sort of looks good but all of a sudden none of the in-game texts (likes scores) show on the phone or any emulator.

    What I've got is a GameCanvas class that has 3 layers; the player's sprite, the monster-sprite and a TiledLayer that draws the background. All works fine.
    Now I want to show the texts of the scores on the screen as well, but when I add the TiledLayer to the LayerManager, it is painted over the texts (which I create on the same Graphics object I paint the layers on).

    Is there any order in which I need to draw everything on the screen, or is there something else I should know?

    Thanks in advance for any help,

    Iwan

  2. #2
    Registered User ChryZzE's Avatar
    Join Date
    Dec 2005
    Posts
    4
    If this is supposed to be part of a HUD that's supposed to be on top of everything the solution is probably simple. Somewhere in you code you most probably have the following lines, and all you need to take care of is to make sure that they are performed in the correct order (bg here is a TiledLayer, but should work allmost the same with a LayerManager - haven't come to that chapter yet):


    Graphics g = getGraphics();
    bg.paint(g);

    g.drawString(my_score, 0, 0, Graphics.LEFT | Graphics.TOP);

  3. #3
    Registered User ieising's Avatar
    Join Date
    Dec 2004
    Posts
    23
    Quote Originally Posted by ChryZzE
    If this is supposed to be part of a HUD that's supposed to be on top of everything the solution is probably simple. Somewhere in you code you most probably have the following lines, and all you need to take care of is to make sure that they are performed in the correct order (bg here is a TiledLayer, but should work allmost the same with a LayerManager - haven't come to that chapter yet):


    Graphics g = getGraphics();
    bg.paint(g);

    g.drawString(my_score, 0, 0, Graphics.LEFT | Graphics.TOP);
    I tried it, but it didn't seem to work at the time. I'll try it again. Thing is I'm using a LayerManager to do all the drawing for me, so maybe I need to go by it myself.

    Currently I'm using a transparent PNG file, that solves my problem.

    Thanks,
    Iwan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved