Package org.newdawn.slick

Examples of org.newdawn.slick.Color


  public void initialize() {
    physicsMapper = world.getMapper(Physics.class);
    healthMapper = world.getMapper(Health.class);
    ammoMapper = world.getMapper(Ammo.class);
   
    healthColor = new Color(72f / 255f, 1f, 0f, 1f);
    bgColor = new Color(1f, 1f, 1f, 0.2f);

    try {
      font = new AngelCodeFont("fonts/normal.fnt", "fonts/normal_0.png");
      bar = new Image("bar.png");
      statusBar = new Image("statusBar.png");
View Full Code Here


      font.drawString(-26, 8, "Health");
      g.rotate(0, 0, -90);
      float healthStatus = health.getHealthStatus();
      g.setDrawMode(Graphics.MODE_ADD);
      statusBar.draw(0,0,statusBar.getWidth()*healthStatus, statusBar.getHeight(), 0,0,statusBar.getWidth()*healthStatus, statusBar.getHeight(), healthStatus<0.25?Color.red:healthStatus<0.6?Color.yellow:Color.green);
      statusBar.draw(statusBar.getWidth()*healthStatus,0,statusBar.getWidth(), statusBar.getHeight(), statusBar.getWidth()*healthStatus,0,statusBar.getWidth(), statusBar.getHeight(), new Color(0.15f,0.15f,0.15f));
      g.setDrawMode(Graphics.MODE_NORMAL);
      g.rotate(0, 0, 90);
    }
    g.translate(-35, -container.getHeight()+45);
  }
View Full Code Here

      font.drawString(-16, 8, "Ammo");
      g.rotate(0, 0, -90);
      float ammoStatus = ammo.getAmmoStatus();
      g.setDrawMode(Graphics.MODE_ADD);
      statusBar.draw(0,0,statusBar.getWidth()*ammoStatus, statusBar.getHeight(), 0,0,statusBar.getWidth()*ammoStatus, statusBar.getHeight(), ammoStatus<0.25?Color.red:ammoStatus<0.6?Color.yellow:Color.green);
      statusBar.draw(statusBar.getWidth()*ammoStatus,0,statusBar.getWidth(), statusBar.getHeight(), statusBar.getWidth()*ammoStatus,0,statusBar.getWidth(), statusBar.getHeight(), new Color(0.15f,0.15f,0.15f));
      g.setDrawMode(Graphics.MODE_NORMAL);
      g.rotate(0, 0, 90);
    }
    g.translate(-container.getWidth()+64, -container.getHeight()+45);
  }
View Full Code Here

    expiraton = expirationMapper.get(owner);

    ComponentMapper<Transform> transformMapper = world.getMapper(Transform.class);
    transform = transformMapper.get(owner);
    radius = 5;
    color = new Color(Color.yellow);
  }
View Full Code Here

  @Override
  public void initialize() {
    healthMapper = world.getMapper(Health.class);
    physicsMapper = world.getMapper(Physics.class);

    healthColor = new Color(72f / 255f, 1f, 0f, 1f);
    bgColor = new Color(1f, 1f, 1f, 0.2f);

    try {
      bar = new Image("healthBar.png");
    } catch (SlickException e) {
      e.printStackTrace();
View Full Code Here

         
    NodeList list = element.getElementsByTagName("image");
    Element imageNode = (Element) list.item(0);
    String ref = imageNode.getAttribute("source");
   
    Color trans = null;
    String t = imageNode.getAttribute("trans");
    if ((t != null) && (t.length() > 0)) {
      int c = Integer.parseInt(t, 16);
     
      trans = new Color(c);
    }

    if (loadImage) {
      Image image = new Image(map.getTilesLocation()+"/"+ref,false,Image.FILTER_NEAREST,trans);
      setTileSetImage(image);
View Full Code Here

       
      }
     
      protected void renderHP(Graphics g)
      {
        g.setColor(new Color(185, 80, 80));
        g.setLineWidth(1);
        g.drawRect(x-width-(36-width)/2, y-height-15, 36, 4);
        g.setColor(Color.red);
        g.fillRect(x-width-(36-width)/2+1, y-height-14, (float)35/hp_default*hp, 3);
      }
View Full Code Here

    case NULL: break;
    case DEAD:
      for (int i = 0; i < 6; i++)
      {
        g.setLineWidth(9);
        g.setColor(new Color(0,90,0)); //poison green
        g.drawRect(x-death_rects_x[i], y-death_rects_y[i], 15+opt_dead/2, 15+opt_dead/2);
        g.setColor(new Color(13,142,19)); //poison green
        g.fillRect(x-death_rects_x[i], y-death_rects_y[i], 15+opt_dead/2, 15+opt_dead/2);
      }
      break;
    default:
      g.setLineWidth(6);
      g.setColor(new Color(0,90,0)); //poison green
      g.drawRect(x-width, y-height, width, height);
      g.setColor(new Color(13,142,19)); //poison green
      g.fillRect(x-width, y-height, width, height);
      break;
    }
  }
View Full Code Here

          fire_y += n_y;
        }
        break;
      }
    }
    col = new Color(190, 190, 190, 0);
    render(Game.app.getGraphics());

  }
View Full Code Here

  public void draw() throws SlickException
  {
    switch(rule)
    {
    case 1:
      col = new Color(255, 255, 170, alpha);
      g.setLineWidth(1);
      g.setColor(col);
      g.drawLine(this.x+GameplayState.player.gun.gun_x, this.y+GameplayState.player.gun.gun_y, curr_x, curr_y);
      break;
    }
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.