Package org.newdawn.slick

Examples of org.newdawn.slick.Image


    this.engine = system;

    if (updateImage) {
      updateImage = false;
      try {
        image = new Image(relativePath + imageName);
      } catch (SlickException e) {
        image = null;
        Log.error(e);
      }
    }
View Full Code Here


   * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
   */
  public void init(GameContainer container) throws SlickException {
    this.container = container;
   
    image = new Image("testdata/logo.tga", true);
    container.setMouseCursor("testdata/palette_tool.png", 0, 0);
   
    container.setIcons(new String[] {"testdata/icon.tga"});
    container.setTargetFrameRate(100);
   
View Full Code Here

    for (int i = 2; i < v.length; i++) {
      if(v[i].length()==0)continue;
      n[i - 2] = Integer.parseInt(v[i]);
    }
    if (v[0].equalsIgnoreCase("addcells")) {
      Image g = getImage(v[1]);
      st.addSheet(g, n[0], n[1], n[2]);
    } else if (v[0].equalsIgnoreCase("addcell")) {
      Image g = getImage(v[1]);
      if (v.length >= 4) {
        st.add(g, n[0], n[1], n[2], n[3]);
      } else {
        st.add(g);
      }
View Full Code Here

        Color c=null;
        if(v.length>2){
          c=new Color(v[2]);
        }
//        System.out.println(" img="+v[0]+" src="+v[1]);
        Image img = new Image(v[1],c);
        imagesMap.put(v[0], img);
      } catch (SlickException e) {
        e.printStackTrace();
      }
View Full Code Here

        GL.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE);
      }
     
      // now get the particle pool for this emitter and render all particles that are in use
      ParticlePool pool = (ParticlePool) particlesByEmitter.get(emitter);
      Image image = emitter.getImage();
      if (image == null) {
        image = this.sprite;
      }
     
      if (!emitter.isOriented() && !emitter.usePoints(this)) {
        image.startUse();
      }
     
      for (int i = 0; i < pool.particles.length; i++)
      {
        if (pool.particles[i].inUse())
          pool.particles[i].render();
      }
     
      if (!emitter.isOriented() && !emitter.usePoints(this)) {
        image.endUse();
      }

      // reset additive blend mode
      if (emitter.useAdditive()) {
        GL.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE_MINUS_SRC_ALPHA);
View Full Code Here

   */
  private void loadSystemParticleImage() {
    AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
            try {
              sprite = new Image(defaultImageName);
            } catch (SlickException e) {
              Log.error(e);
              defaultImageName = null;
            }
                return null; // nothing to return
View Full Code Here

  public void render(GameContainer container, Graphics g)
      throws SlickException {
    try {
      if (backgroundImage != null) {
        if (background == null) {
          background = new Image(
              new FileInputStream(backgroundImage),
              backgroundImage.getAbsolutePath(), false);
        }
      }
    } catch (Exception e) {
View Full Code Here

  }

  public TButton(float x, float y, int width, int height) {
    super(x, y, width, height);
    try {
      image = new Image("gui/button-black.png");
      hover = new Image("gui/button-black-hover.png");
    } catch (SlickException e) {
      e.printStackTrace();
    }
  }
View Full Code Here


  @Override
  public void paint(Graphics g) {   
    //super.paint(g);
    Image img = image;
   
    if(isMouseEnterState() && hover != null)
      img=hover;
     
    if(img!=null){ 
      int iw = img.getWidth();
      int ih = img.getHeight();     
      g.drawImage(img,0,0,getWidth(),getHeight(),0,0,iw,ih,bcolor);
    }
    int h = getFont().getLineHeight();
    h = (getHeight()-h)/2;
    getFont().drawString(10,h,caption);
View Full Code Here

      @Override
      public void init(GameContainer arg0) throws SlickException{
       //setTargetFrameRate(100);
        //Image img1 = new Image("data/img/backGrounds/bg_def.png");
//        Image img1 = new Image("data/img/gui/cirno_Pic_01.png");
        Image img1 = new Image("data/blackmage.png");
        callable = new PsuedoPerspectiveCall(img1);
      }
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.