Package org.newdawn.slick

Examples of org.newdawn.slick.Color


   *            Shape
   * @param c
   *            Die Farbe mit der das Shape gefüllt wird
   */
  public static void fill(Graphics g, NextShape shape, Color c) {
    Color cur = g.getColor();
    g.setColor(c);
    fill(g, shape);
    g.setColor(cur);
  }
View Full Code Here


   *            Die Größe des Kreuzes, mit dem die Position markiert wird
   *            (Länge des Kreuzes vom Zentrum in alle Richtungen)
   */
  public static void markPosition(Graphics g, Vector position,
      float distance, Color c) {
    Color save = g.getColor();
    g.setColor(c);
    g.drawLine(position.x - distance, position.y, position.x + distance,
        position.y);
    g.drawLine(position.x, position.y - distance, position.x, position.y
        + distance);
View Full Code Here

  public void draw(Graphics g) {
    Vector pos = this.getCenterVector();
    Shape actShape = this.shape.modifyCenter(pos);
    GraphicUtils.drawImage(g, actShape, ResourceManager.getInstance()
        .getImage(this.icon));
    Color c = g.getColor();
    switch (this.getStatus()) {
    case STATUS_MOUSE_OVER:
      g.setColor(Color.yellow);
      GraphicUtils.drawString(g, pos, this.getFunction()
          .getFunctionName());
View Full Code Here

      int height = Font.getHeight(this.buttonText);
      this.shape = new Rectangle(Vector.ZERO, width, height);
    }
    Vector pos = this.getCenterVector();
    this.shape = (Rectangle) this.shape.modifyCenter(pos);
    Color c = g.getColor();
    switch (this.getStatus()) {
    case STATUS_MOUSE_OVER:
      g.setColor(Color.yellow);
      break;
    case STATUS_DOWN:
View Full Code Here

   * @param endCol The colour to apply at the ending control point
   */
  public GradientFill(Vector2f start, Color startCol, Vector2f end, Color endCol) {
    this.start = new Vector2f(start);
    this.end = new Vector2f(end);
    this.startCol = new Color(startCol);
    this.endCol = new Color(endCol);
  }
View Full Code Here

   * Set the colour to apply at the start control's position
   *
   * @param color The colour to apply at the start control point
   */
  public void setStartColor(Color color) {
    this.startCol = new Color(color);
  }
View Full Code Here

   * Set the colour to apply at the end control's position
   *
   * @param color The colour to apply at the end control point
   */
  public void setEndColor(Color color) {
    this.endCol = new Color(color);
  }
View Full Code Here

   
    float u = ua;
    float v = 1 - u;
   
    // u is the proportion down the line we are
    Color col = new Color(1,1,1,1);
    col.r = (u * endCol.r) + (v * startCol.r);
    col.b = (u * endCol.b) + (v * startCol.b);
    col.g = (u * endCol.g) + (v * startCol.g);
    col.a = (u * endCol.a) + (v * startCol.a);
   
 
View Full Code Here

   
    float f = -0.1f + hoverTimer / 60.0f + downTimer / 40.0f;
    if (activated) {
      f += 0.4f;
    }
    Color colFill1 = new Color(b.r + f, b.g + f, b.b + f, b.a);
    f -= 0.1f;
    Color colFill2 = new Color(b.r + f, b.g + f, b.b + f, b.a);
    Color colBorder;
    if (!enabled) {
      f = 0;
    } else if (activated) {
      f = 0.2f;
    } else {
      f = -0.2f;
    }
    colBorder = new Color(b.r + f, b.g + f, b.b + f, b.a);
    Color colCheck;
    if (enabled) {
      colCheck = Color.white;
    } else {
      colCheck = new Color(0.5f, 0.5f, 0.5f, 1.0f);
    }
   
    g.drawRectangle(x, y, width, height, colFill1, colFill1, colFill2, colFill2);
   
    // Draw outer border
    g.drawRectangle(x, y, width, 1, colBorder);
    g.drawRectangle(x, y, 1, height,colBorder);
    g.drawRectangle(x, y + height -1 , width, 1, colBorder);
    g.drawRectangle(x + width - 1, y, 1, height, colBorder);
   
    if (fnt != null && text != null) {
      int decal = 0;
      if (!selectable) {
        decal = -height + 4;
      }
      fnt.setAlign(ADXFont.H_ALIGN_LEFT, ADXFont.V_ALIGN_MIDDLE);
      g.drawText(fnt, text, x + height + decal + 1, y + height / 2 + 1, Color.black);
      g.drawText(fnt, text, x + height + decal, y + height / 2, Color.white);
    }
   
    if (selectable && activated) {
      g.drawRectangle(x + 8, y + 8, height - 16, 1, Color.white);
      g.drawRectangle(x + 8, y + height - 9, height - 16, 1, Color.white);
      g.drawRectangle(x + 8, y + 8, 1, height - 16, Color.white);
      g.drawRectangle(x + height - 9, y + 8, 1, height - 16, Color.white);
      g.drawRectangle(x + 8, y + 8, height - 16, height - 16, new Color(colCheck.r, colCheck.g, colCheck.b, colCheck.a - 0.5f));
    }
   
  }
View Full Code Here

 
  @Override
  public void render(ADXGame game, ADXGraphics g) {
   
    if (modal) {
      g.drawRectangle(0, 0, game.getWidth(), game.getHeight(), new Color(0.0f, 0.0f, 0.0f, 0.75f));
      g.drawRectangle(x, y, width, height, new Color(b.r, b.g, b.b, 0.66f + hoverTimer / 30.0f));
    } else {
      g.drawRectangle(x, y, width, height, new Color(b.r, b.g, b.b, 0.80f + hoverTimer / 50.0f));
    }
   
    float f = 0.3f;
    Color colInBorder = new Color(b.r + f, b.g + f, b.b + f, b.a);
    f = -0.3f;
    Color colOutBorder = new Color(b.r + f, b.g + f, b.b + f, b.a);
   
    // Draw inner border
    g.drawRectangle(x + 1, y + 1, width - 2, 1, colInBorder);
    g.drawRectangle(x + 1, y + 1, 1, height - 2, colInBorder);
    g.drawRectangle(x + 1, y + height - 2, width - 2, 1, colInBorder);
View Full Code Here

TOP

Related Classes of org.newdawn.slick.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.