Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.Color


    cam = new OrthographicCamera();
    cam.setToOrtho(false, width, height);
    // cam.position.

    // used to change alpha
    color = new Color();

    batch = new SpriteBatch();
    batch.setProjectionMatrix(cam.combined);
    stage = new Stage(width, height, false, batch);
View Full Code Here


            for (int y = Main.game.world.WORLD_HEIGHT - 1; y >= 0; y--) {
                if (Main.game.world.tiles[x][y] instanceof Building) {

                    Building building = (Building) Main.game.world.tiles[x][y];

                    Color color = Repository.grey;

                    if (building.team != null) {
                        if (building.team.equals(Main.game.blueTeam) || Main.game.visible.contains(building) || !Main.game.world.FOG_OF_WAR || building.tiletyp.equals(Repository.tiletypObjectMap.get("hq"))) {
                            color = building.team.color;
                        }
View Full Code Here

            rendermanager.drawIndependent(Main.textureRegionObjectMap.get("timer"), 0.35f, 0.8f, 0.3f, 0.4f, 0);
        }


        rendermanager.drawIndependent(Main.textureRegionObjectMap.get("clock"), 0.43f, 0.87f, 0.05f, 1f, 0);
        Color color = Color.GREEN;

        if (ts < 5) {
            color = Color.YELLOW;
        }
        if (ts < 2) {
View Full Code Here

      Slot slot = new Slot(slotData, this, bone);
      slots.add(slot);
      drawOrder.add(slot);
    }

    color = new Color(1, 1, 1, 1);
  }
View Full Code Here

    drawOrder = new Array(slots.size);
    for (Slot slot : skeleton.drawOrder)
      drawOrder.add(slots.get(skeleton.slots.indexOf(slot, true)));

    skin = skeleton.skin;
    color = new Color(skeleton.color);
    time = skeleton.time;
  }
View Full Code Here

  Slot () {
    data = null;
    bone = null;
    skeleton = null;
    color = new Color(1, 1, 1, 1);
  }
View Full Code Here

    if (skeleton == null) throw new IllegalArgumentException("skeleton cannot be null.");
    if (bone == null) throw new IllegalArgumentException("bone cannot be null.");
    this.data = data;
    this.skeleton = skeleton;
    this.bone = bone;
    color = new Color();
    setToSetupPose();
  }
View Full Code Here

    if (skeleton == null) throw new IllegalArgumentException("skeleton cannot be null.");
    if (bone == null) throw new IllegalArgumentException("bone cannot be null.");
    data = slot.data;
    this.skeleton = skeleton;
    this.bone = bone;
    color = new Color(slot.color);
    attachment = slot.attachment;
    attachmentTime = slot.attachmentTime;
  }
View Full Code Here

    return region;
  }

  public void updateVertices (Slot slot) {
    Skeleton skeleton = slot.getSkeleton();
    Color skeletonColor = skeleton.getColor();
    Color slotColor = slot.getColor();
    float color = NumberUtils.intToFloatColor( //
      ((int)(255 * skeletonColor.a * slotColor.a) << 24) //
        | ((int)(255 * skeletonColor.b * slotColor.b) << 16) //
        | ((int)(255 * skeletonColor.g * slotColor.g) << 8) //
        | ((int)(255 * skeletonColor.r * slotColor.r)));
 
View Full Code Here

    public void apply (Skeleton skeleton, float time, float alpha) {
      float[] frames = this.frames;
      if (time < frames[0]) return; // Time is before first frame.

      Color color = skeleton.slots.get(slotIndex).color;

      if (time >= frames[frames.length - 5]) { // Time is after last frame.
        int i = frames.length - 1;
        float r = frames[i - 3];
        float g = frames[i - 2];
        float b = frames[i - 1];
        float a = frames[i];
        color.set(r, g, b, a);
        return;
      }

      // Interpolate between the last frame and the current frame.
      int frameIndex = binarySearch(frames, time, 5);
      float lastFrameR = frames[frameIndex - 4];
      float lastFrameG = frames[frameIndex - 3];
      float lastFrameB = frames[frameIndex - 2];
      float lastFrameA = frames[frameIndex - 1];
      float frameTime = frames[frameIndex];
      float percent = MathUtils.clamp(1 - (time - frameTime) / (frames[frameIndex + LAST_FRAME_TIME] - frameTime), 0, 1);
      percent = getCurvePercent(frameIndex / 5 - 1, percent);

      float r = lastFrameR + (frames[frameIndex + FRAME_R] - lastFrameR) * percent;
      float g = lastFrameG + (frames[frameIndex + FRAME_G] - lastFrameG) * percent;
      float b = lastFrameB + (frames[frameIndex + FRAME_B] - lastFrameB) * percent;
      float a = lastFrameA + (frames[frameIndex + FRAME_A] - lastFrameA) * percent;
      if (alpha < 1)
        color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);
      else
        color.set(r, g, b, a);
    }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.Color

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.