public void draw(LGraphics g, int x, int y) {
   next();
   g.setColor(color);
   for (int j = 0; j < value; j++) {
     pos[j][0] += vector[j][0];
     pos[j][1] += vector[j][1];
     int nx = (int) (pos[j][0]) - x;
     int ny = (int) (pos[j][1]) - y;
     g.drawLine(nx, ny, nx, ny);
   }
   if (super.frame > wait) {
     setExist(false);
   }
 }
  public void draw(LGraphics g, int x, int y) {
    next();
    int frame = super.frame;
    if (frame <= 15) {
      frame = 15;
    }
    LFont font = g.getFont();
    g.setFont(deffont);
    for (int j = 0; j < str.length(); j++) {
      char c = str.charAt(j);
      int nx = (super.target[0] + len + j * 6) - x;
      int ny = super.target[1] - 3 - y;
      if (super.frame < 10) {
        ny = (ny += 5) - super.frame / 2;
      }
      g.drawStyleString(String.valueOf(c), nx, ny, LColor.white, color);
    }

    g.setFont(font);
    if (super.frame > 20) {
      setExist(false);
    }
  }
 /** 更新游戏画布 */
 public void update() {
   try {
     if (!isRunning) {
       return;
     }
     canvas = surfaceHolder.lockCanvas(null);
     if (canvas != null) {
       synchronized (surfaceHolder) {
         gl.update(canvas);
       }
       surfaceHolder.unlockCanvasAndPost(canvas);
     }
   } catch (Exception e) {
   }
 }
Exemple #4
0
 /**
  * 创建UI图像
  *
  * @param g
  */
 public void createUI(final LGraphics g, final int x, final int y) {
   if (!visible) {
     return;
   }
   int minX, minY, maxX, maxY;
   int clipX = g.getClipX();
   int clipY = g.getClipY();
   int clipWidth = g.getClipWidth();
   int clipHeight = g.getClipHeight();
   if (this.isViewWindowSet) {
     g.setClip(x, y, this.width, this.height);
     minX = this.viewX;
     maxX = minX + this.width;
     minY = this.viewY;
     maxY = minY + this.height;
   } else {
     minX = x;
     maxX = x + clipWidth;
     minY = y;
     maxY = y + clipHeight;
   }
   g.translate(x - this.viewX, y - this.viewY);
   for (int i = 0; i < this.size; i++) {
     ISprite spr = sprites[i];
     if (spr.isVisible()) {
       int layerX = spr.x();
       int layerY = spr.y();
       int layerWidth = spr.getWidth();
       int layerHeight = spr.getHeight();
       if (layerX + layerWidth < minX
           || layerX > maxX
           || layerY + layerHeight < minY
           || layerY > maxY) {
         continue;
       }
       spr.createUI(g);
     }
   }
   g.translate(-(x - this.viewX), -(y - this.viewY));
   if (this.isViewWindowSet) {
     g.setClip(clipX, clipY, clipWidth, clipHeight);
   }
 }
Exemple #5
0
 public void createUI(LGraphics g) {
   if (isVisible) {
     g.drawImage(animation.getSpriteImage().getImage(), x(), y());
   }
 }
Exemple #6
0
 public synchronized void draw(LGraphics g) {
   g.drawImage(characterCG, moveX, y);
 }