public void render() {
   BitmapFont font = FEResources.getBitmapFont("default_med");
   if (hasFocus) {
     Renderer.drawRectangle(x, y, x + width, y + height, renderDepth, FOCUSED);
     float linepos = x + font.getStringWidth(input.substring(0, cursorPos)) + 2;
     Renderer.drawRectangle(
         linepos, y + 1, linepos + 1, y + height - 1, renderDepth - 0.02f, CURSOR);
   } else {
     Renderer.drawRectangle(x, y, x + width, y + height, renderDepth, UNFOCUSED);
   }
   Renderer.drawString("default_med", input.toString(), x + 2, y + 5, renderDepth - 0.01f);
 }
 public void render() {
   Renderer.drawRectangle(0, 0, 480, 320, renderDepth, new Color(0, 0, 0, 0.5f));
   Renderer.drawBorderedRectangle(
       x,
       y,
       x + 100,
       y + 40,
       renderDepth,
       FightStage.NEUTRAL,
       FightStage.BORDER_LIGHT,
       FightStage.BORDER_DARK);
   Renderer.drawString("default_med", "Are you sure?", x + 2, y + 2, renderDepth);
   if (yesHover) Renderer.setColor(Color.green);
   Renderer.drawString("default_med", "YES", x + 5, y + 20, renderDepth);
   if (!yesHover) Renderer.setColor(Color.green);
   else Renderer.setColor(null);
   Renderer.drawString("default_med", "NO", x + 55, y + 20, renderDepth);
   Renderer.setColor(null);
 }
Beispiel #3
0
  public void render() {
    ClientOverworldStage cs = (ClientOverworldStage) stage;
    Renderer.translate(-cs.camX, -cs.camY);
    Renderer.addClip(0, 0, 368, 240, true);

    if (FEResources.hasTexture(functionalClassName().toLowerCase() + "_map_idle")) {
      Transform t = new Transform();
      if (sprite.getAnimationName().equals("RIGHT")) {
        t.flipHorizontal();
        t.setTranslation(14, 0); // Why do we have to do this?
      }
      Color mod = new Color(1.0f, 1.0f, 1.0f, 1.0f);
      t.setColor(mod);
      if (moved) {
        sprite.render(x + 1 + rX, y + 1 + rY, renderDepth, t, new ShaderArgs("greyscale"));
      } else {
        ShaderArgs args = PaletteSwapper.setup(this);
        sprite.render(x + 1 + rX, y + 1 + rY, renderDepth, t, args);
      }
    } else {
      Color c = !moved ? new Color(getPartyColor()) : new Color(128, 128, 128);
      Renderer.drawRectangle(
          x + 1 + rX, y + 1 + rY, x + 14 + rX, y + 14 + rY, ClientOverworldStage.UNIT_DEPTH, c);
      Renderer.drawString(
          "default_med",
          name.charAt(0) + "" + name.charAt(1),
          x + 2 + rX,
          y + 1 + rY,
          ClientOverworldStage.UNIT_DEPTH);
    }
    if (rescuedUnit != null) {
      counter += Game.getDeltaSeconds();
      counter %= 1;
      if (counter > 0.5) {
        Renderer.render(rescue, 0, 0, 1, 1, x + 9, y + 7, x + 9 + 8, y + 7 + 8, renderDepth);
      }
    }

    Renderer.removeClip();
    Renderer.translate(cs.camX, cs.camY);
  }
Beispiel #4
0
  /* (non-Javadoc)
   * @see chu.engine.Entity#render()
   */
  public void render() {
    // Main status
    Renderer.drawRectangle(
        FightStage.CENTRAL_AXIS + sign * 120,
        FightStage.FLOOR + 12,
        FightStage.CENTRAL_AXIS,
        FightStage.FLOOR + 56,
        renderDepth,
        FightStage.BORDER_DARK);
    Renderer.drawRectangle(
        FightStage.CENTRAL_AXIS + sign * 119,
        FightStage.FLOOR + 13,
        FightStage.CENTRAL_AXIS + sign,
        FightStage.FLOOR + 55,
        renderDepth,
        FightStage.BORDER_LIGHT);
    Renderer.drawRectangle(
        FightStage.CENTRAL_AXIS + sign * 118,
        FightStage.FLOOR + 14,
        FightStage.CENTRAL_AXIS + sign * 2,
        FightStage.FLOOR + 54,
        renderDepth,
        unit.getPartyColor().darker(0.5f));

    // Weapon
    Renderer.drawRectangle(
        FightStage.CENTRAL_AXIS + sign * 119,
        FightStage.FLOOR + 13,
        FightStage.CENTRAL_AXIS + sign,
        FightStage.FLOOR + 31,
        renderDepth,
        FightStage.BORDER_LIGHT);
    Renderer.drawRectangle(
        FightStage.CENTRAL_AXIS + sign * 118,
        FightStage.FLOOR + 14,
        FightStage.CENTRAL_AXIS + sign * 2,
        FightStage.FLOOR + 30,
        renderDepth,
        FightStage.NEUTRAL);

    // Attack Stats
    Renderer.drawRectangle(
        FightStage.CENTRAL_AXIS + sign * 120,
        FightStage.FLOOR + 2,
        FightStage.CENTRAL_AXIS + sign * 76,
        FightStage.FLOOR + 32,
        renderDepth,
        FightStage.BORDER_DARK);
    Renderer.drawRectangle(
        FightStage.CENTRAL_AXIS + sign * 119,
        FightStage.FLOOR + 3,
        FightStage.CENTRAL_AXIS + sign * 77,
        FightStage.FLOOR + 31,
        renderDepth,
        FightStage.BORDER_LIGHT);
    Renderer.drawRectangle(
        FightStage.CENTRAL_AXIS + sign * 118,
        FightStage.FLOOR + 4,
        FightStage.CENTRAL_AXIS + sign * 78,
        FightStage.FLOOR + 30,
        renderDepth,
        unit.getPartyColor());

    Renderer.render(
        battleStats,
        0,
        0,
        1,
        1,
        FightStage.CENTRAL_AXIS + sign * 98 - 18,
        FightStage.FLOOR + 5,
        FightStage.CENTRAL_AXIS + sign * 98 - 3,
        FightStage.FLOOR + 29,
        renderDepth);

    Renderer.drawString(
        "stat_numbers",
        hit,
        FightStage.CENTRAL_AXIS + sign * 98 - 5,
        FightStage.FLOOR + 5,
        renderDepth);

    Renderer.drawString(
        "stat_numbers",
        dmg,
        FightStage.CENTRAL_AXIS + sign * 98 - 5,
        FightStage.FLOOR + 13,
        renderDepth);

    Renderer.drawString(
        "stat_numbers",
        crit,
        FightStage.CENTRAL_AXIS + sign * 98 - 5,
        FightStage.FLOOR + 21,
        renderDepth);

    // Name
    Renderer.drawRectangle(
        FightStage.CENTRAL_AXIS + sign * 120,
        FightStage.FLOOR - 99,
        FightStage.CENTRAL_AXIS + sign * 63,
        FightStage.FLOOR - 77,
        renderDepth,
        FightStage.BORDER_DARK);
    Renderer.drawRectangle(
        FightStage.CENTRAL_AXIS + sign * 120,
        FightStage.FLOOR - 98,
        FightStage.CENTRAL_AXIS + sign * 64,
        FightStage.FLOOR - 78,
        renderDepth,
        FightStage.BORDER_LIGHT);
    Renderer.drawRectangle(
        FightStage.CENTRAL_AXIS + sign * 120,
        FightStage.FLOOR - 97,
        FightStage.CENTRAL_AXIS + sign * 65,
        FightStage.FLOOR - 79,
        renderDepth,
        unit.getPartyColor());
    Renderer.drawString(
        "default_med", unit.name, FightStage.CENTRAL_AXIS + sign * 94 - 16, 11, 0.0f);
  }