Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.Color


          timeline.setSlotIndex(slotIndex);

          int frameIndex = 0;
          for (JsonValue valueMap = timelineMap.child(); valueMap != null; valueMap = valueMap.next()) {
            float time = valueMap.getFloat("time");
            Color color = Color.valueOf(valueMap.getString("color"));
            timeline.setFrame(frameIndex, time, color.r, color.g, color.b, color.a);
            readCurve(timeline, frameIndex, valueMap);
            frameIndex++;
          }
          timelines.add(timeline);
View Full Code Here


      offsetX = style.unpressedOffsetX;
      offsetY = style.unpressedOffsetY;
    }

    if (background != null) {
      Color color = getColor();
      batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
      background.draw(batch, getX(), getY(), getWidth(), getHeight());
    }

    Array<Actor> children = getChildren();
View Full Code Here

  }

  public Color getColor () {
    float floatBits = color;
    int intBits = NumberUtils.floatToIntColor(color);
    Color color = tempColor;
    color.r = (intBits & 0xff) / 255f;
    color.g = ((intBits >>> 8) & 0xff) / 255f;
    color.b = ((intBits >>> 16) & 0xff) / 255f;
    color.a = ((intBits >>> 24) & 0xff) / 255f;
    return color;
View Full Code Here

  public void draw (SpriteBatch spriteBatch) {
    spriteBatch.draw(texture, getVertices(), 0, SPRITE_SIZE);
  }

  public void draw (SpriteBatch spriteBatch, float alphaModulation) {
    Color color = getColor();
    float oldAlpha = color.a;
    color.a *= alphaModulation;
    setColor(color);
    draw(spriteBatch);
    color.a = oldAlpha;
View Full Code Here

  /** Returns the color of this sprite. Changing the returned color will have no affect, {@link #setColor(Color)} or
   * {@link #setColor(float, float, float, float)} must be used. */
  public Color getColor () {
    int intBits = NumberUtils.floatToIntColor(vertices[C1]);
    Color color = this.color;
    color.r = (intBits & 0xff) / 255f;
    color.g = ((intBits >>> 8) & 0xff) / 255f;
    color.b = ((intBits >>> 16) & 0xff) / 255f;
    color.a = ((intBits >>> 24) & 0xff) / 255f;
    return color;
View Full Code Here

  }

  /** @return the rendering color of this SpriteBatch. Manipulating the returned instance has no effect. */
  public Color getColor () {
    int intBits = NumberUtils.floatToIntColor(color);
    Color color = this.tempColor;
    color.r = (intBits & 0xff) / 255f;
    color.g = ((intBits >>> 8) & 0xff) / 255f;
    color.b = ((intBits >>> 16) & 0xff) / 255f;
    color.a = ((intBits >>> 24) & 0xff) / 255f;
    return color;
View Full Code Here

  }

  /** @return the rendering color of this PolygonSpriteBatch. Manipulating the returned instance has no effect. */
  public Color getColor () {
    int intBits = NumberUtils.floatToIntColor(color);
    Color color = this.tempColor;
    color.r = (intBits & 0xff) / 255f;
    color.g = ((intBits >>> 8) & 0xff) / 255f;
    color.b = ((intBits >>> 16) & 0xff) / 255f;
    color.a = ((intBits >>> 24) & 0xff) / 255f;
    return color;
View Full Code Here

    this.color = color;
  }

  public Color getColor () {
    int intBits = NumberUtils.floatToIntColor(color);
    Color color = this.tempColor;
    color.r = (intBits & 0xff) / 255f;
    color.g = ((intBits >>> 8) & 0xff) / 255f;
    color.b = ((intBits >>> 16) & 0xff) / 255f;
    color.a = ((intBits >>> 24) & 0xff) / 255f;
    return color;
View Full Code Here

    if (fontScaleX != 1 || fontScaleY != 1) font.setScale(oldScaleX, oldScaleY);
  }

  public void draw (SpriteBatch batch, float parentAlpha) {
    validate();
    Color color = getColor();
    if (style.background != null) {
      batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
      style.background.draw(batch, getX(), getY(), getWidth(), getHeight());
    }
    cache.setColor(style.fontColor == null ? color : Color.tmp.set(color).mul(style.fontColor));
View Full Code Here

      this.fontColor = fontColor;
    }

    public LabelStyle (LabelStyle style) {
      this.font = style.font;
      if (style.fontColor != null) fontColor = new Color(style.fontColor);
      background = style.background;
    }
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.