Package org.newdawn.slick

Examples of org.newdawn.slick.Image


    this(img, tw, th, null);
  }

  public SpriteSheet(String imgFile, int tw, int th, Color tcolor) {
    try {
      Image img = new Image(imgFile, tcolor);
      addSheet(img, tw, th, 0);
    } catch (SlickException e) {
    }
  }
View Full Code Here


    if (in != null) {
      BufferedReader bin = new BufferedReader(new InputStreamReader(in));
      String line = null;
      try {
        line = bin.readLine();
        Image img = new Image(line);
        while ((line = bin.readLine()) != null) {
          line = line.trim();
          if (line.length() > 0)
            add(img, line);
        }
View Full Code Here

      a[1] = new ImageActor(220f, 500f, 0f, 0f, "logo/openal.png");
      a[2] = new ImageActor(320f, 500f, 0f, 0f, "logo/lwjgl.png");
      a[3] = new ImageActor(400f, 500f, 0f, 0f, "logo/slick.png");
      a[4] = new ImageActor(400f, 500f, 0f, 0f, "logo/foogl.png");
      try {
        Image logo = applet.getLogo();
        if (logo == null)
          logo = new Image("logo/foogl.png");
        a[5] = new ImageActor(400f, 500f, 0f, 0f,logo);
      } catch (SlickException e) {
      }

      a[0].setX(w - a[0].getWidth());
View Full Code Here

  public int getZorder() {
    return super.getZorder() - 10;
  }
  @Override
  public void paint(Graphics g) {
    Image img = getImg();
    if(img==null){
      getParent().getViewPort();
    }
  }
View Full Code Here

  void init(StateBasedGame game, GameContainer container) {
    w = container.getWidth();
    h = container.getHeight();
    if (img2 == null) {
      try {
        img3 = new Image(w, h);
      } catch (SlickException e) {
      }
    } else {
      img3 = img2;
    }
View Full Code Here

    time += delta;
    int w = container.getWidth();
    int h = container.getHeight();
    if (state1 != null) {
      if (img1 == null) {
        img1 = new Image(container.getWidth(), container.getHeight());
        scene1.setImg(img1);
      }
      Graphics g1 = img1.getGraphics();
      Graphics.setCurrent(g1);
      g1.setColor(Color.black);
      g1.fillRect(0, 0, w, h);
      state1.render(container, game, g1);
      g1.flush();
    }
    if (state2 != null) {
      if (img2 == null) {
        img2 = new Image(container.getWidth(), container.getHeight());
        scene2.setImg(img2);
      }
      Graphics g2 = img2.getGraphics();
      Graphics.setCurrent(g2);
      g2.setColor(Color.black);
View Full Code Here

    try {
      this.img = new Image[imageFile.length];
      this.imgFile = imageFile;
      this.tranColor = tranColor;
      for (int i = 0; i < imageFile.length; i++) {
        this.img[i] = new Image(imageFile[i], tranColor);
      }
      curframe = 0;
      if (img[0] != null) {
        if (getWidth() == 0)
          setWidth(img[0].getWidth());
View Full Code Here

  public void showFullscreen() {
    showFrame(800, 600, true);
  }
  public Image getLogo(){
    try {
      return new Image("logo/foogl.png");
    } catch (SlickException e) {
      e.printStackTrace();
    }
    return null;
  }
View Full Code Here

 
  /**
   * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
   */
  public void init(GameContainer container) throws SlickException {
    image = tga = new Image("testdata/logo.png");
        rotImage = new Image("testdata/logo.png");
        rotImage = rotImage.getScaledCopy(rotImage.getWidth() / 2, rotImage.getHeight() / 2);
        //rotImage.setCenterOfRotation(0,0);
       
    scaleMe = new Image("testdata/logo.tga", true, Image.FILTER_NEAREST);
    gif = new Image("testdata/logo.gif");
    scaled = gif.getScaledCopy(120, 120);
    subImage = image.getSubImage(200,0,70,260);
    rot = 0;
   
    if (exitMe) {
      container.exit();
    }
   
    Image test = tga.getSubImage(50,50,50,50);
    System.out.println(test.getColor(50, 50));
  }
View Full Code Here

    g.drawRect(0,0,image.getWidth(),image.getHeight());
    image.draw(0,0);
    image.draw(500,0,200,100);
    scaleMe.draw(500,100,200,100);
    scaled.draw(400,500);
    Image flipped = scaled.getFlippedCopy(true, false);
    flipped.draw(520,500);
    Image flipped2 = flipped.getFlippedCopy(false, true);
    flipped2.draw(520,380);
    Image flipped3 = flipped2.getFlippedCopy(true, false);
    flipped3.draw(400,380);
   
    for (int i=0;i<3;i++) {
      subImage.draw(200+(i*30),300);
    }
   
 
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.