Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.Color


    }

    public WindowStyle (WindowStyle style) {
      this.background = style.background;
      this.titleFont = style.titleFont;
      this.titleFontColor = new Color(style.titleFontColor);
    }
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

      widgetCullingArea.height = widgetAreaBounds.height;
      ((Cullable)widget).setCullingArea(widgetCullingArea);
    }

    // Draw the background ninepatch.
    Color color = getColor();
    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
    if (style.background != null) {
      style.background.draw(batch, 0, 0, getWidth(), getHeight());
      batch.flush();
    }
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

  @Override
  public void draw (Batch 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

  public void draw (Batch batch, float parentAlpha) {
    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();
View Full Code Here

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

    this.color = color;
  }

  public Color getColor () {
    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 (Batch spriteBatch, float alphaModulation) {
    if (alphaModulation == 1) {
      draw(spriteBatch);
      return;
    }
    Color color = getColor();
    float oldAlpha = color.a;
    color.a *= alphaModulation;
    setColors(color);
    draw(spriteBatch);
    color.a = oldAlpha;
View Full Code Here

          if (ch == ']') {
            if (colorBuffer.length() == 0) {
              this.color = previousColor;
            } else {
              String colorString = colorBuffer.toString();
              Color newColor = Colors.get(colorString);
              if (newColor == null) throw new GdxRuntimeException("Unknown color '" + colorString + "'");
              this.previousColor = this.color;
              this.color = newColor.toFloatBits();
            }
            return i - start;
          } else {
            colorBuffer.append(ch);
          }
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.