Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.Color


  /** Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background
   * drawable. */
  protected void drawBackground (SpriteBatch batch, float parentAlpha) {
    if (background != null) {
      Color color = getColor();
      batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
      background.draw(batch, getX(), getY(), getWidth(), getHeight());
    }
  }
View Full Code Here


    return newDrawable(getDrawable(name));
  }

  /** Returns a tinted copy of a drawable found in the skin via {@link #getDrawable(String)}. */
  public Drawable newDrawable (String name, float r, float g, float b, float a) {
    return newDrawable(getDrawable(name), new Color(r, g, b, a));
  }
View Full Code Here

    throw new GdxRuntimeException("Unable to copy, unknown drawable type: " + drawable.getClass());
  }

  /** Returns a tinted copy of a drawable found in the skin via {@link #getDrawable(String)}. */
  public Drawable newDrawable (Drawable drawable, float r, float g, float b, float a) {
    return newDrawable(drawable, new Color(r, g, b, a));
  }
View Full Code Here

        if (hex != null) return Color.valueOf(hex);
        float r = json.readValue("r", float.class, 0f, jsonData);
        float g = json.readValue("g", float.class, 0f, jsonData);
        float b = json.readValue("b", float.class, 0f, jsonData);
        float a = json.readValue("a", float.class, 1f, jsonData);
        return new Color(r, g, b, a);
      }
    });

    json.setSerializer(TintedDrawable.class, new ReadOnlySerializer() {
      public Object read (Json json, JsonValue jsonData, Class type) {
        String name = json.readValue("name", String.class, jsonData);
        Color color = json.readValue("color", Color.class, jsonData);
        return newDrawable(name, color);
      }
    });

    return json;
View Full Code Here

  @Override
  public void draw (SpriteBatch batch, float parentAlpha) {
    BitmapFont font = style.font;
    Drawable selectedDrawable = style.selection;
    Color fontColorSelected = style.fontColorSelected;
    Color fontColorUnselected = style.fontColorUnselected;

    Color color = getColor();
    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);

    float x = getX();
    float y = getY();

View Full Code Here

  @Override
  public void draw (SpriteBatch batch, float parentAlpha) {
    validate();

    Color c = getColor();
    batch.setColor(c.r, c.g, c.b, c.a * parentAlpha);

    float x = getX();
    float y = getY();
    float w = getWidth();
View Full Code Here

  @Override
  public void draw (SpriteBatch batch, float parentAlpha) {
    validate();

    Color color = getColor();

    Drawable handle = style.handle;
    applyTransform(batch, computeTransform());
    Matrix4 transform = batch.getTransformMatrix();
    if (firstWidget != null) {
View Full Code Here

    final Drawable knob = (disabled && style.disabledKnob != null) ? style.disabledKnob : style.knob;
    final Drawable bg = (disabled && style.disabledBackground != null) ? style.disabledBackground : style.background;
    final Drawable knobBefore = (disabled && style.disabledKnobBefore != null) ? style.disabledKnobBefore : style.knobBefore;
    final Drawable knobAfter = (disabled && style.disabledKnobAfter != null) ? style.disabledKnobAfter : style.knobAfter;

    Color color = getColor();
    float x = getX();
    float y = getY();
    float width = getWidth();
    float height = getHeight();
    float knobHeight = knob == null ? 0 : knob.getMinHeight();
View Full Code Here

    Stage stage = getStage();
    boolean focused = stage != null && stage.getKeyboardFocus() == this;

    final BitmapFont font = style.font;
    final Color fontColor = (disabled && style.disabledFontColor != null) ? style.disabledFontColor
      : ((focused && style.focusedFontColor != null) ? style.focusedFontColor : style.fontColor);
    final Drawable selection = style.selection;
    final Drawable cursorPatch = style.cursor;
    final Drawable background = (disabled && style.disabledBackground != null) ? style.disabledBackground
      : ((focused && style.focusedBackground != null) ? style.focusedBackground : style.background);

    Color color = getColor();
    float x = getX();
    float y = getY();
    float width = getWidth();
    float height = getHeight();
    float textY = textBounds.height / 2 + font.getDescent();
View Full Code Here

      this.selection = selection;
    }

    public TextFieldStyle (TextFieldStyle style) {
      this.messageFont = style.messageFont;
      if (style.messageFontColor != null) this.messageFontColor = new Color(style.messageFontColor);
      this.background = style.background;
      this.focusedBackground = style.focusedBackground;
      this.disabledBackground = style.disabledBackground;
      this.cursor = style.cursor;
      this.font = style.font;
      if (style.fontColor != null) this.fontColor = new Color(style.fontColor);
      if (style.focusedFontColor != null) this.focusedFontColor = new Color(style.focusedFontColor);
      if (style.disabledFontColor != null) this.disabledFontColor = new Color(style.disabledFontColor);
      this.selection = style.selection;
    }
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.