Package org.newdawn.slick

Examples of org.newdawn.slick.ImageBuffer


    world.setGravity(-10);

    p1 = new Player(p1Name);
    p2 = new Player(p2Name);
   
    terrainy = new ImageBuffer(Constants.MAX_WIDTH, Constants.MAX_HEIGHT*2);
   
    terrainBitmap = Noise.GenerateWhiteNoise(Constants.MAX_WIDTH,Constants.MAX_HEIGHT*2);
    terrainBitmap = Noise.GenerateSmoothNoise(terrainBitmap,7);
    terrainBitmap = Noise.GeneratePerlinNoise(terrainBitmap,7);
   
View Full Code Here


    worldCenterY = gc.getHeight() / 2;
    world = new World();
    world.setIterations(Constants.ITERATIONS);
    world.setGravity(-10);
   
    terrainy = new ImageBuffer(Constants.MAX_WIDTH, Constants.MAX_HEIGHT*2);
   
    SlickDisplay();
    terrainyImage = terrainy.getImage();
    createTerrainBody2(-terrainyImage.getWidth()/2, -terrainyImage.getHeight()/2);
 
View Full Code Here

        if (j < 7) {
          idx = j;
        } else {
          idx = (13 - j);
        }
        ImageBuffer ib = new ImageBuffer(20, 20);
        for (int x = 0; x < 20; x++) {
          for (int y = 0; y < 20; y++) {
            c0 = img[idx][(alternativa?impl.getEstilo2():impl.getEstilo()).getNumero() - 1].getColor(x, y);
            c1 = null;
            if (c0.equals(franja)) {
              if (impl.getJugadores()[i].esPortero()) {
                c1 = uportero;
              } else {
                c1 = ufranja;
              }
            } else if (c0.equals(polera)) {
              if (impl.getJugadores()[i].esPortero()) {
                c1 = uportero;
              } else {
                c1 = upolera;
              }
            } else if (c0.equals(piel)) {
              c1 = upiel;
            } else if (c0.equals(pelo)) {
              c1 = upelo;
            } else if (c0.equals(pantalon)) {
              if (impl.getJugadores()[i].esPortero()) {
                c1 = uportero;
              } else {
                c1 = upantalon;
              }
            } else if (c0.equals(calcetas)) {
              c1 = ucalcetas;
            } else if (c0.equals(zapatos)) {
              c1 = zapatos;
            }
            if (c1 != null) {
              ib.setRGBA(x, y, c1.getRed(), c1.getGreen(), c1.getBlue(), c1.getAlpha());
            }
          }
        }
        imgJug[i][j] = ib.getImage();
      }
    }
  }
View Full Code Here

    depth = 250; // lightmap is on top of all of them, but below the blender
    whiteSquare = createImage(tilesize);
  }

  private Image createImage(int tilesize) {
    ImageBuffer buf = new ImageBuffer(tilesize, tilesize);
    for (int x = 0; x < tilesize; x++)
      for (int y = 0; y < tilesize; y++)
        buf.setRGBA(x, y, 255, 255, 255, 255);
    return buf.getImage();
  }
View Full Code Here

   
    int w = old.getWidth();
    int h = old.getHeight();
   
    // Create a new image buffer to fill with pixels
    ImageBuffer buf = new ImageBuffer(w, h);
    Color c = new Color(0, 0, 0);
   
    for (int y = 0; y < h; y++)
      for (int x = 0; x < w; x++) {
        c = old.getColor(x, y);
        c = replace(c);
        buf.setRGBA(x, y, (int) (c.r * 255), (int) (c.g * 255), (int) (c.b * 255), (int) (c.a * 255));
      }
    return new Image(buf);
  }
View Full Code Here

      // Extract dimensions
      int w = MonolithResource.readInteger(data, 8);
      int h = MonolithResource.readInteger(data, 12);
     
      // Create a new image buffer to fill with pixels
      ImageBuffer buf = new ImageBuffer(w, h);
     
      // Extract palette
      Color[] palette = new Color[256];
      // Read
      int len = data.length;
View Full Code Here

  /**
   * Generate the image used for texturing the gradient across shapes
   */
  public void genImage() {
    if (image == null) {
      ImageBuffer buffer = new ImageBuffer(128,16);
      for (int i=0;i<128;i++) {
        Color col = getColorAt(i / 128.0f);
        for (int j=0;j<16;j++) {
          buffer.setRGBA(i, j, col.getRedByte(), col.getGreenByte(), col.getBlueByte(), col.getAlphaByte());
        }
      }
      image = buffer.getImage();
    }
  }
View Full Code Here

          } else if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) {
             endian = "Little endian";
          } else
             endian = "no idea";
     
      redImageBuffer = new ImageBuffer(100,100);
      fillImageBufferWithColor(redImageBuffer, Color.red, 100, 100);
     
      blueImageBuffer = new ImageBuffer(100,100);
      fillImageBufferWithColor(blueImageBuffer, Color.blue, 100, 100);
     
      fromRed = redImageBuffer.getImage();
      fromBlue = blueImageBuffer.getImage();
   }
View Full Code Here

 
  /**
   * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
   */
  public void init(GameContainer container) throws SlickException {
    ImageBuffer buffer = new ImageBuffer(320,200);
    for (int x=0;x<320;x++) {
      for (int y=0;y<200;y++) {
        if (y == 20) {
          buffer.setRGBA(x, y, 255,255,255,255);
        } else {
          buffer.setRGBA(x, y, x,y,0,255);
        }
      }
    }
    image = buffer.getImage();
  }
View Full Code Here

TOP

Related Classes of org.newdawn.slick.ImageBuffer

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.