Package org.newdawn.slick

Examples of org.newdawn.slick.Graphics


      util_knife--;
    if (util_knife < 1)
    {
      util_knife = 0;
      Rectangle rect = new Rectangle(GameplayState.player.pl_center.getX()+(GameplayState.player.util_facing?20:-55), GameplayState.player.pl_center.getY()-30, 35, 60);
      Graphics g = Game.app.getGraphics();
      g.setLineWidth(1);
      g.setColor(Color.red);
      g.draw(rect);
      for (int i = 0; i < MonsterHandler.monster_array.size(); ++i)
      {
        Monster mob = MonsterHandler.monster_array.get(i);
        if ((rect.intersects(mob.hitbox) || rect.contains(mob.hitbox)) && mob.state != MS.DEAD && mob.state != MS.NULL)
        {
View Full Code Here


    float w1 = w / 16f;
    float h1 = h / 16f;
    float h2;
   
    if (img3 != null) {
      Graphics g = img1.getGraphics();
      Graphics.setCurrent(g);
        h2= h1 * t*2;
        if(h2>h1)h2=h1;
        for (int r = 0; r < 16; r++) {
          for (int c = 0; c < 8; c++) {
            float x = (w1) * (c * 2 + r % 2);
            float y = (h1) * r;
            g.drawImage(img3, x, y, x + w1, y + h2, x, y, x + w1, y
                + h2);
          }
        }
      if (t > 0.5f){
        h2= h1 * (t-0.5f)*2;
        for (int r = 0; r < 16; r++) {
          for (int c = 0; c < 8; c++) {
            float x = (w1) * (c * 2 + (r+1)%2);
            float y = (h1) * r;
            g.drawImage(img3, x, y, x + w1, y + h2, x, y, x + w1, y
                + h2);
          }
        }
      }
      g.flush();
    }
  }
View Full Code Here

    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);
      g2.fillRect(0, 0, w, h);
      state2.render(container, game, g2);
      g2.flush();
    }
    if (!inited) {
      init(game,container);
      inited = true;
    }
View Full Code Here

                 page.add(widget);
              } catch (ThingleException ex) {
                 ex.printStackTrace();
              }

              Graphics g = container.getGraphics();
              g.setBackground(Color.white);
           }

           public void update (GameContainer container, int delta) throws SlickException {
              page.update(delta);
           }

           public void render (GameContainer container, Graphics g) throws SlickException {
              g.setColor(Color.lightGray);
              g.fillRect(25, 25, 550, 750);

              page.render();
           }
        };
        AppGameContainer container = new AppGameContainer(game);
View Full Code Here

   * @return The graphics context
   * @throws SlickException Indicates it wasn't possible to create a graphics context
   * given available hardware.
   */
  public static Graphics getGraphicsForImage(Image image) throws SlickException {
    Graphics g = (Graphics) graphics.get(image.getTexture());
   
    if (g == null) {
      g = createGraphics(image);
      graphics.put(image.getTexture(), g);
    }
View Full Code Here

   *
   * @param image The image to release
   * @throws SlickException Indicates a failure to release the context
   */
  public static void releaseGraphicsForImage(Image image) throws SlickException {
    Graphics g = (Graphics) graphics.remove(image.getTexture());
   
    if (g != null) {
      g.destroy();
    }
  }
View Full Code Here

   * @return The graphics context
   * @throws SlickException Indicates it wasn't possible to create a graphics context
   * given available hardware.
   */
  public static Graphics getGraphicsForImage(Image image) throws SlickException {
    Graphics g = (Graphics) graphics.get(image.getTexture());
   
    if (g == null) {
      g = createGraphics(image);
      graphics.put(image.getTexture(), g);
    }
View Full Code Here

   *
   * @param image The image to release
   * @throws SlickException Indicates a failure to release the context
   */
  public static void releaseGraphicsForImage(Image image) throws SlickException {
    Graphics g = (Graphics) graphics.remove(image.getTexture());
   
    if (g != null) {
      g.destroy();
    }
  }
View Full Code Here

TOP

Related Classes of org.newdawn.slick.Graphics

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.