| 发表于:2007-03-27 18:41:173楼 得分:0 |
好像没有啊,我在按下下一个之后就是调用gamecanvas了: gamecanvas = new gamecanvas(this,isplayercircle,isplayerfirst); display.setcurrent(gamecanvas); 在gamecanvas类里的paint()方法主要调用 public void paint(graphics graphic) { if(game.isgameover()) paintgameover(graphic); else paintgame(g); } paintgame()是: private void paintgame(graphics g) { if(boardimage != null){ system.out.println( "come in paintgame "); g.setcolor(white); g.fillrect(0,0,this.getwidth(),this.getheight()); g.drawimage(boardimage, boardleft, boardtop, graphics.top ¦graphics.left); } } 一开始进去主要是调用 private void drawboard(){ g.setcolor(white); g.fillrect(0, 0, boardimage.getwidth(), boardimage.getheight()); g.setcolor(black); for(int i=0;i <4;i++){ system.out.println( "come in drowborad "); g.fillrect(0, boardcellwidth*i, boardcellwidth*3+2, 2); g.fillrect(boardcellwidth*i, 0, 2, boardcellwidth*3); } } 方法。 可能是这个方法会不出想要的图像啊 | | |
|