Esempio n. 1
0
 /** sets batch to game units to draw and then back to screen */
 @Override
 public void draw(SpriteBatch batch, float parentAlpha) {
   tmpMatrix4.set(batch.getProjectionMatrix());
   batch.setProjectionMatrix(cam.combined);
   super.draw(batch, parentAlpha);
   batch.setProjectionMatrix(tmpMatrix4);
 }
Esempio n. 2
0
 public void draw(SpriteBatch batch, float parentAlpha, Texture tex) {
   doAlter(batch, parentAlpha);
   if (!visibleForPlayer) return;
   batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
   batch.draw(
       tex,
       x,
       y,
       originX,
       originY,
       width,
       height,
       scaleX,
       scaleY,
       rotation,
       0,
       0,
       tex.getWidth(),
       tex.getHeight(),
       false,
       false);
   super.draw(batch, color.a * parentAlpha);
   // Log.i("", "DrawParam:"+ x+","+ y+"," +originX+","+ originY+","+ width+","+ height+","+
   // scaleX+",\n"+
   //	 scaleY+","+ rotation+","+ 0+","+ 0+","+ tex.getWidth()+","+  tex.getHeight()+","+  false+","
   // + false);
 }
Esempio n. 3
0
  /**
   * *********************************************************************************** This
   * renders stuff on the screen
   * ***********************************************************************************
   */
  @Override
  public void draw(SpriteBatch batch, float parentAlpha) {
    final Color c = getColor();
    batch.setColor(c.r, c.g, c.b, c.a * parentAlpha);

    if (texture != null) {
      batch.draw(texture, getX(), getY(), getWidth(), getHeight());
    } else if (region != null) {
      batch.draw(region, getX(), getY(), getWidth(), getHeight());
    }

    super.draw(batch, parentAlpha);
  }
Esempio n. 4
0
  public void draw() {
    Camera camera = viewport.getCamera();
    camera.update();

    if (!root.isVisible()) return;

    Batch batch = this.batch;
    if (batch != null) {
      batch.setProjectionMatrix(camera.combined);
      batch.begin();
      root.draw(batch, 1);
      batch.end();
    }

    if (debug) drawDebug();
  }
Esempio n. 5
0
  @Override
  public void draw(Batch batch, float parentAlpha) {
    batch.setColor(Colours.LIGHT);
    Draw.fillActor(batch, this);

    switch (state) {
      case Cross:
        batch.setColor(Colours.DARK);
        Draw.drawLine(batch, getX(), getY(), getX() + getWidth(), getY() + getHeight(), 1);
        Draw.drawLine(batch, getX() + getWidth(), getY(), getX(), getY() + getHeight(), 1);
        break;
      case Off:
        break;
      case On:
        batch.setColor(Colours.DARK);
        Draw.fillActor(batch, this);
        break;
      default:
        break;
    }
    super.draw(batch, parentAlpha);
  }
Esempio n. 6
0
 @Override
 public void draw(Batch batch, float parentAlpha) {
   if (isDraw) {
     super.draw(batch, parentAlpha);
   }
 }
Esempio n. 7
0
 @Override
 public void draw(Batch batch, float parentAlpha) {
   super.draw(batch, parentAlpha);
   if (mHighlightView.isVisible()) mHighlightView.draw(batch, this);
 }
Esempio n. 8
0
 public void draw(SpriteBatch batch, float parentAlpha) {
   if (!visible) return;
   if (layout.needsLayout) layout.layout();
   super.draw(batch, parentAlpha);
 }
Esempio n. 9
0
 @Override
 public void draw(SpriteBatch batch, float parentAlpha) {
   doAlter(batch, parentAlpha);
   super.draw(batch, color.a * parentAlpha);
 }
Esempio n. 10
0
 public void draw(SpriteBatch batch) {
   stage.draw();
   SpriteBatch sb = (SpriteBatch) stage.getBatch();
   sb.begin();
   FontUtil.draw(sb, item.name, 22, Color.WHITE, 455, 134, 1000);
   FontUtil.draw(sb, item.illustration, 18, Color.DARK_GRAY, 459, 100, 490);
   scuse.draw(sb);
   if (sellist.isVisible()) sellist.draw(sb, 1);
   scfor.draw(sb);
   if (herolist.isVisible()) {
     herolist.draw(sb, 1);
     sb.flush();
     if (herolist.getSelectedIndex() != -1
         && herolist.getSelected().userObject != null
         && !(herolist.getSelected().userObject instanceof Image)) {
       Hero h = ((Hero) herolist.getSelected().userObject);
       render.begin(ShapeType.Filled);
       render.setColor(green);
       render.rect(
           575, 142, (float) ((float) h.prop.get("hp") / (float) h.prop.get("maxhp")) * 176, 20);
       render.setColor(cblue);
       render.rect(
           575, 105, (float) ((float) h.prop.get("mp") / (float) h.prop.get("maxmp")) * 176, 20);
       render.end();
       FontUtil.draw(
           sb,
           h.prop.get("hp") + "/" + h.prop.get("maxhp"),
           16,
           blue,
           572
               + 176 / 2
               - FontUtil.getTextWidth(h.prop.get("hp") + "/" + h.prop.get("maxhp"), 20, -7) / 2,
           158,
           400,
           -5,
           0);
       FontUtil.draw(
           sb,
           h.prop.get("mp") + "/" + h.prop.get("maxmp"),
           16,
           blue,
           572
               + 176 / 2
               - FontUtil.getTextWidth(h.prop.get("mp") + "/" + h.prop.get("maxmp"), 20, -7) / 2,
           121,
           400,
           -5,
           0);
       FontUtil.draw(
           sb, "正常", 18, blue, 563 + 176 / 2 - FontUtil.getTextWidth("正常", 18) / 2, 196, 400);
       FontUtil.draw(sb, h.toString(), 18, Color.WHITE, 515, 227, 200);
       if (drawp) {
         add.draw(sb, Gdx.graphics.getDeltaTime());
         drawp = !add.isComplete();
       } else add.reset();
       sb.draw(h.images[1].getRegion(), 810, 97);
     }
     sb.flush();
   }
   if (group.isVisible()) {
     group.draw(batch, 1);
     String tmp = String.valueOf(currentCount);
     tmp = tmp.length() == 1 ? "00" + tmp : tmp.length() == 2 ? "0" + tmp : tmp;
     Image i1 = NumberUtil.get(tmp.substring(0, 1));
     i1.setPosition(390, 275);
     i1.draw(sb);
     Image i2 = NumberUtil.get(tmp.substring(1, 2));
     i2.setPosition(430, 275);
     i2.draw(sb);
     Image i3 = NumberUtil.get(tmp.substring(2, 3));
     i3.setPosition(470, 275);
     i3.draw(sb);
   }
   sb.end();
 }
Esempio n. 11
0
 @Override
 public void draw(Batch batch, float parentAlpha) {
   Border.draw(batch, getX(), getY(), getWidth(), getHeight(), false);
   super.draw(batch, parentAlpha);
 }