Package org.newdawn.slick

Examples of org.newdawn.slick.Image


      default:
        offset = 0;
        break;
      }
      float offset_x = util_img.getWidth()*(1f-0.6f/8*i)/2;
      Image img = util_img.getScaledCopy(1f-0.6f/8*i);
      img.setAlpha(1f-(0.5f/8*i));
      img.draw(400-offset_x, Game.getAppY()-94-i*38+offset);
      Text.drawString(40-3*i, Text.extractLength(""+str[0], 40-3*i), Game.getAppY()-84-i*39+offset, ""+str[0], new Color(255, 0, 0, 255-102/8*i));
    }
 
View Full Code Here


    }
   
  public void addToQueue(ITEM id, String[] str)
  {
    showup_queue.add(str);
    Image img = id.getIcon();
    img = img.getScaledCopy(2f);
    img.setFilter(Image.FILTER_NEAREST);
    showup_icon.add(img);
  }
View Full Code Here

   * @return Image
   * @throws SlickException
   */
  public static Image loadImage(String string)
  {
    Image img = null;
    String path = new java.io.File("").getAbsolutePath()+"/res/";
    try
    {
      img = new Image(path+string);
    }
    catch (java.lang.RuntimeException | SlickException e)
    {
      try //feature to skip .png ending without errors
      {
        img = new Image(path+string+".png");
      }
      catch(java.lang.RuntimeException | SlickException e1)
      {
        try { return new Image("res/particle/no_image.png"); } catch (SlickException e3) {} //return blank image
      }
    }
    return img;
  }
View Full Code Here

  }
   
  public void loadHeightMap(){
    try {
      // load texture from PNG file
      hMap = new Image(TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/heightMap.png")));
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

  public static int LAZER_PAUR = 40;
 
 
  public ProjectileEntitySmall(double startX, double startY){
    super(ProjectileType.small, startX, startY);
    this.img = new Image(projectileTex);
    img.setCenterOfRotation(8, 8);
    rotSpeed = Chunk.rand.nextInt(10)+1;
    width = 8.0;
    height = 8.0;
    maskWidth = 6.0;
View Full Code Here

    super(ProjectileType.destroy, x, y);
    if (ss == null){
      ss = new Image[4];
      try {
        for (int i = 0; i<4; i++){
          ss[i] = new Image(TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/test"+i+".png")));
        }
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
View Full Code Here

    }
    if (ss == null){
      ss = new Image[4];
      try {
        for (int i = 0; i<4; i++){
          ss[i] = new Image(TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/player"+i+".png")));
        }
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
View Full Code Here

        emergencyAnimation.setAutoUpdate(true);

        for (int row = 0; row < getEmergencySpriteSheet(emergencyType).getHorizontalCount(); row++) {
            for (int frame = 0; frame < getEmergencySpriteSheet(emergencyType).getVerticalCount(); frame++) {
                try {
                    Image sprite = getEmergencySpriteSheet(emergencyType).getSprite(row, frame);
                    if (numberOfPeople != null) {
                        sprite.getGraphics().drawString("" + numberOfPeople, sprite.getWidth() / 2, sprite.getHeight() / 2);
                    }
                    emergencyAnimation.addFrame(sprite, 250);
                } catch (SlickException ex) {
                    Logger.getLogger(AnimationFactory.class.getName()).log(Level.SEVERE, null, ex);
                }
View Full Code Here

        glowAnimation.setAutoUpdate(true);

        for (int row = 0; row < getGlowSpriteSheet().getHorizontalCount(); row++) {
            for (int frame = 0; frame < getGlowSpriteSheet().getVerticalCount(); frame++) {
                try {
                    Image sprite = getGlowSpriteSheet().getSprite(row, frame);
                    sprite.getGraphics().drawImage(graphicable.getAnimation().getCurrentFrame(), 0, 0);
                    glowAnimation.addFrame(sprite, 250);
                } catch (SlickException ex) {
                    Logger.getLogger(AnimationFactory.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
View Full Code Here

   */
  @SuppressWarnings("deprecation")
  @Override
  public void init(GameContainer gc) throws SlickException {
//    gc.getGraphics().setBackground(Color.white);
    m_loadImage = new Image("res/load.jpg");
//    m_loadImage = m_loadImage.getScaledCopy(gc.getWidth() / m_loadImage.getWidth());
    m_loadImage = m_loadImage.getScaledCopy(800.0f / m_loadImage.getWidth());

    m_loadBarLeft = new Image("res/ui/loadbar/left.png");
    m_loadBarRight = new Image("res/ui/loadbar/right.png");
    m_loadBarMiddle = new Image("res/ui/loadbar/middle.png");
   
    LoadingList.setDeferredLoading(true);
   
   
    m_instance = this;
View Full Code Here

TOP

Related Classes of org.newdawn.slick.Image

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.