Package org.newdawn.slick

Examples of org.newdawn.slick.Image


       */
      for(int i = -5; i < 224; i++) {
        try {

          location = respath+"res/characters/" + String.valueOf(i) + ".png";
          m_spriteImageArray[i + 5] = new Image(location);
         
        } catch (Exception e) {
          location = respath+"res/characters/" + String.valueOf(i) + ".png";
          m_spriteImageArray[i + 5] = new Image(location);
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here


        LoadingList.setDeferredLoading(true);
        String respath = System.getProperty("res.path");
        if(respath==null)
          respath="";
        f = FileLoader.loadFile(respath+"res/ui/speechbox.png");
        bg = new Image(f, respath+"res/ui/speechbox.png", false);
        LoadingList.setDeferredLoading(false);
      } catch (Exception e) {
        e.printStackTrace();
      }
View Full Code Here

    String m_path = respath+"res/badges/";
    // Kanto Badges
    for (int i = 0; i < 8; i++) {
      try {
        // KANTO
        m_kanto[i] = new Label(new Image(m_path
            + "kanto" + (i + 1) + ".png", false));
        m_kanto[i].setSize(18, 18);
        m_kanto[i].setX(maxLblWidth + (20 * i));
        m_kanto[i].setY(m_coordinatingEXP.getY()
            + m_coordinatingEXP.getHeight() + 2);
        getContentPane().add(m_kanto[i]);

        // JOHTO
        m_johto[i] = new Label(new Image(m_path
            + "johto" + (i + 1) + ".png", false));
        m_johto[i].setSize(18, 18);
        m_johto[i].setX(2 + maxLblWidth + (20 * i));
        m_johto[i].setY(2 + m_kanto[i].getY() + m_kanto[i].getHeight());
        getContentPane().add(m_johto[i]);

        // HOENN
        if (ALL_REGIONS) {
          m_hoenn[i] = new Label(new Image(m_path + "hoenn" + (i + 1) + ".png", false));
          m_hoenn[i].setSize(18, 18);
          m_hoenn[i].setX(2 + maxLblWidth + (20 * i));
          m_hoenn[i].setY(2 + m_johto[i].getY()
              + m_johto[i].getHeight());
          getContentPane().add(m_hoenn[i]);
        }
        // SINNOH
        if (ALL_REGIONS) {
          m_sinnoh[i] = new Label(new Image(m_path + "sinnoh" + (i + 1) + ".png", false));
          m_sinnoh[i].setSize(18, 18);
          m_sinnoh[i].setX(2 + maxLblWidth + (20 * i));
          m_sinnoh[i].setY(2 + m_hoenn[i].getY()
              + m_hoenn[i].getHeight());
          getContentPane().add(m_sinnoh[i]);
        }
        // ORANGE ISLANDS
        if (ALL_REGIONS) {
          if (i < 4) {
            m_orange[i] = new Label(new Image(m_path + "orange" + (i + 1) + ".png", false));
            m_orange[i].setSize(18, 18);
            m_orange[i].setX(2 + maxLblWidth + (20 * i));
            m_orange[i].setY(2 + m_sinnoh[i].getY()
                + m_sinnoh[i].getHeight());
            getContentPane().add(m_orange[i]);
          }
        }
        // Extra badges ???
        if (ALL_REGIONS) {
          if (i < 6) {
            m_extras[i] = new Label(new Image(m_path + "extra" + (i + 1) + ".png", false));
            m_extras[i].setSize(18, 18);
            m_extras[i].setX(2 + maxLblWidth + (20 * i));
            m_extras[i].setY(2 + m_orange[i].getY()
                + m_orange[i].getHeight());
            getContentPane().add(m_extras[i]);
View Full Code Here

      ic -= 2;
    } else {
      ic ++;
    }
        try {
          m_theirPokes[index].setImage(new Image(Pokemon.getIconPathByIndex(ic)));
        } catch (SlickException e){}
        LoadingList.setDeferredLoading(false);
       
        // Load pokemon data
        OurPokemon tempPoke = new OurPokemon().initTradePokemon(data);
View Full Code Here

    String respath = System.getProperty("res.path");
    if(respath==null)
      respath="";
    try {
      Image[] bagcat = new Image[] {
          new Image(FileLoader.loadFile(respath+"res/ui/bag/bag_normal.png"), "res/ui/bag/bag_normal.png", false),
          new Image(FileLoader.loadFile(respath+"res/ui/bag/bag_hover.png"), "res/ui/bag/bag_hover.png", false),
          new Image(FileLoader.loadFile(respath+"res/ui/bag/bag_pressed.png"), "res/ui/bag/bag_pressed.png", false)};
      Image[] potioncat = new Image[] {
          new Image(FileLoader.loadFile(respath+"res/ui/bag/potions_normal.png"), "res/ui/bag/potions_normal.png", false),
          new Image(FileLoader.loadFile(respath+"res/ui/bag/potions_hover.png"), "res/ui/bag/potions_hover.png", false),
          new Image(FileLoader.loadFile(respath+"res/ui/bag/potions_pressed.png"), "res/ui/bag/potions_pressed.png", false) };
      Image[] berriescat = new Image[] {
          new Image(FileLoader.loadFile(respath+"res/ui/bag/berries_normal.png"), "res/ui/bag/berries_normal.png", false),
          new Image(FileLoader.loadFile(respath+"res/ui/bag/berries_hover.png"), "res/ui/bag/berries_hover.png", false),
          new Image(FileLoader.loadFile(respath+"res/ui/bag/berries_pressed.png"), "res/ui/bag/berries_pressed.png", false)};
      Image[] pokecat = new Image[] {
          new Image(FileLoader.loadFile(respath+"res/ui/bag/pokeballs_normal.png"), "res/ui/bag/pokeballs_normal.png", false),
          new Image(FileLoader.loadFile(respath+"res/ui/bag/pokeballs_hover.png"), "res/ui/bag/pokeballs_hover.png", false),
          new Image(FileLoader.loadFile(respath+"res/ui/bag/pokeballs_pressed.png"), "res/ui/bag/pokeballs_pressed.png", false) };
      Image[] tmscat = new Image[] {
          new Image(FileLoader.loadFile(respath+"res/ui/bag/tms_normal.png"), "res/ui/bag/tms_normal.png", false),
          new Image(FileLoader.loadFile(respath+"res/ui/bag/tms_hover.png"), "res/ui/bag/tms_hover.png", false),
          new Image(FileLoader.loadFile(respath+"res/ui/bag/tms_pressed.png"), "res/ui/bag/tms_pressed.png", false) };
      for (int i = 0; i < m_categoryButtons.length; i++) {
        final int j = i;

        switch (i) {
        case 0:
          m_categoryButtons[i] = new ImageButton(bagcat[0],
              bagcat[1], bagcat[2]);
          m_categoryButtons[i].setToolTipText("Bag");
          break;
        case 1:
          m_categoryButtons[i] = new ImageButton(potioncat[0],
              potioncat[1], potioncat[2]);
          m_categoryButtons[i].setToolTipText("Potions");
          break;
        case 2:
          m_categoryButtons[i] = new ImageButton(berriescat[0],
              berriescat[1], berriescat[2]);
          m_categoryButtons[i].setToolTipText("Food");
          break;
        case 3:
          m_categoryButtons[i] = new ImageButton(pokecat[0],
              pokecat[1], pokecat[2]);
          m_categoryButtons[i].setToolTipText("Pokeballs");
          break;
        case 4:
          m_categoryButtons[i] = new ImageButton(tmscat[0],
              tmscat[1], tmscat[2]);
          m_categoryButtons[i].setToolTipText("TMs");
          break;
        }

        m_items.put(i, new ArrayList<PlayerItem>());
        m_scrollIndex.put(i, 0);
        m_categoryButtons[i].setSize(40, 40);
        if (i == 0)
          m_categoryButtons[i].setLocation(80, 10);
        else
          m_categoryButtons[i].setLocation(m_categoryButtons[i - 1]
              .getX() + 65, 10);
        m_categoryButtons[i].setFont(GameClient.getFontLarge());
        m_categoryButtons[i].setOpaque(false);
        m_categoryButtons[i].addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            destroyPopup();
            m_curCategory = j;
            m_update = true;
          }
        });
        getContentPane().add(m_categoryButtons[i]);
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
    // Bag Image
    Label bagicon = new Label("");
    bagicon.setSize(40, 40);

    LoadingList.setDeferredLoading(true);
    try {
      bagicon.setImage(new Image(respath+"res/ui/bag/front.png", false));
    } catch (SlickException e1) {
    }
    LoadingList.setDeferredLoading(false);

    bagicon.setLocation(18, 0);
View Full Code Here

        respath="";
      try {
        Label tempLabel = new Label();
        if (i ==0) {
          f = FileLoader.loadFile(respath+"res/ui/party_info/partyActive.png");
          tempLabel = new Label(new Image(f, respath+"res/ui/party_info/partyActive.png", false));
        } else {
          f = FileLoader.loadFile(respath+"res/ui/party_info/partyInactive.png");
          tempLabel = new Label(new Image(f, respath+"res/ui/party_info/partyInactive.png", false));
        }
        tempLabel.setSize(170, 42);
        tempLabel.setY(-4);
        m_container[i].add(tempLabel);
      } catch (Exception e) {e.printStackTrace();}
     
      try{
        f = FileLoader.loadFile(respath+"res/ui/party_info/HPBar.png");
        m_hpBar[i] = new Label(new Image(f, respath+"res/ui/party_info/HPBar.png", false));
        m_hpBar[i].setSize(98, 11);
        m_hpBar[i].setVisible(false);
        m_container[i].add(m_hpBar[i]);
      } catch (Exception e) {e.printStackTrace();}
     
View Full Code Here

      String respath = System.getProperty("res.path");
      if(respath==null)
        respath="";
      try {
        f = FileLoader.loadFile(respath+"res/ui/Pokeball.gif");
        m_pokeBall[i].setImage(new Image(f, respath+"res/ui/Pokeball.gif", false));
        m_pokeBall[i].setSize(30, 30);
      } catch (SlickException e) {
        System.out.println("Couldn't load pokeball");
      } catch (FileNotFoundException e) {
        System.out.println("Couldn't load pokeball");
View Full Code Here

  public void render(GUIContext container, Graphics g) {
    super.render(container, g);
    if (m_mustLoadSprite != null) {
      try {
        m_stream = FileLoader.loadFile(m_mustLoadSprite);
        m_spriteDisplay.setImage(new Image(m_stream, m_mustLoadSprite, false));
      } catch (SlickException e) {
        e.printStackTrace();
      } catch (FileNotFoundException e) {
        e.printStackTrace();
      }
View Full Code Here

   * Loads the status icons
   */
  public void loadStatusIcons(){
    LoadingList.setDeferredLoading(true);
    try{
      m_statusIcons.put("Poison", new Image(m_path + "PSN" + ".png", false));
    } catch (SlickException e) {e.printStackTrace();} try{
      m_statusIcons.put("Sleep", new Image(m_path + "SLP" + ".png", false));
    } catch (SlickException e) {e.printStackTrace();} try{
      m_statusIcons.put("Freze", new Image(m_path + "FRZ" + ".png", false));
    } catch (SlickException e) {e.printStackTrace();} try{
      m_statusIcons.put("Burn", new Image(m_path + "BRN" + ".png", false));
    } catch (SlickException e) {e.printStackTrace();} try{
      m_statusIcons.put("Paralysis", new Image(m_path + "PAR" + ".png", false));
    } catch (SlickException e) {e.printStackTrace();}
    LoadingList.setDeferredLoading(false);
  }
View Full Code Here

    String respath = System.getProperty("res.path");
    if(respath==null)
      respath="";
    try {
      f = FileLoader.loadFile(respath+"res/ui/bg.png");
      m_bg = new Label(new Image(f, respath+"res/ui/bg.png", false));
    } catch (SlickException e) {
      e.printStackTrace();
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
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.