Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.Color


  public void draw (SpriteBatch spriteBatch, float alphaModulation) {
    if (alphaModulation == 1) {
      draw(spriteBatch);
      return;
    }
    Color color = getColor();
    float oldAlpha = color.a;
    color.a *= alphaModulation;
    setColor(color);
    draw(spriteBatch);
    color.a = oldAlpha;
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

      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

    else if (clickListener.isOver() && style.backgroundOver != null)
      background = style.backgroundOver;
    else
      background = style.background;
    final BitmapFont font = style.font;
    final Color fontColor = (disabled && style.disabledFontColor != null) ? style.disabledFontColor : style.fontColor;

    Color color = getColor();
    float x = getX();
    float y = getY();
    float width = getWidth();
    float height = getHeight();
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

  /** 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

    }

    public SelectBoxStyle (SelectBoxStyle style) {
      this.font = style.font;
      this.fontColor.set(style.fontColor);
      if (style.disabledFontColor != null) this.disabledFontColor = new Color(style.disabledFontColor);
      this.background = style.background;
      this.backgroundOver = style.backgroundOver;
      this.backgroundOpen = style.backgroundOpen;
      this.backgroundDisabled = style.backgroundDisabled;
      this.scrollStyle = new ScrollPaneStyle(style.scrollStyle);
View Full Code Here

      deltaMultiplier = new NumericValue();
      deltaMultiplier.setValue(1.0f);
      deltaMultiplier.setActive(true);

      backgroundColor = new GradientColorValue();
      Color color = Color.valueOf("878787");
      backgroundColor.setColors(new float[] { color.r, color.g, color.b});

      models = new Array<Model>();
      ModelBuilder builder = new ModelBuilder();
      Model   xyzModel = builder.createXYZCoordinates(10, new Material(), Usage.Position|Usage.ColorPacked),
View Full Code Here

    gamePanel.add(new LwjglCanvas(renderer = new Renderer()).getCanvas());

    prefs = Preferences.userNodeForPackage(Hiero4.class);
    java.awt.Color backgroundColor = EffectUtil.fromString(prefs.get("background", "000000"));
    backgroundColorLabel.setIcon(getColorIcon(backgroundColor));
    renderingBackgroundColor = new Color(backgroundColor.getRed() / 255f, backgroundColor.getGreen() / 255f,
      backgroundColor.getBlue() / 255f, 1);

    boolean useFontList = getFontFile(Font.decode("Arial")) != null;
    fontList.setEnabled(useFontList);
    systemFontRadio.setEnabled(useFontList);
View Full Code Here

    backgroundColorLabel.addMouseListener(new MouseAdapter() {
      public void mouseClicked (MouseEvent evt) {
        java.awt.Color color = JColorChooser.showDialog(null, "Choose a background color",
          EffectUtil.fromString(prefs.get("background", "000000")));
        if (color == null) return;
        renderingBackgroundColor = new Color(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 1);
        backgroundColorLabel.setIcon(getColorIcon(color));
        prefs.put("background", EffectUtil.toString(color));
      }
    });
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.