Exemplo n.º 1
0
 public static BufferedImage[] clipImage(String src, int column, int row) {
   BufferedImage src_img = Tools.readImage(src);
   BufferedImage[] ret = new BufferedImage[column * row];
   int sw = src_img.getWidth() / column;
   int sh = src_img.getHeight() / row;
   int i = 0;
   for (int c = 0; c < column; c++) {
     for (int r = 0; r < row; r++) {
       ret[i] = src_img.getSubimage(c * sw, r * sh, sw, sh);
       i++;
     }
   }
   return ret;
 }
Exemplo n.º 2
0
public class Res {
  //	---------------------------------------------------------------------------------------------------------------
  //	icon
  public static BufferedImage icon_cpj = Tools.readImage("/com/g2d/studio/res/icon_cpj.png");
  public static BufferedImage icon_edit = Tools.readImage("/com/g2d/studio/res/icon_edit.png");
  public static BufferedImage icon_error = Tools.readImage("/com/g2d/studio/res/icon_error.png");
  public static BufferedImage icon_hd = Tools.readImage("/com/g2d/studio/res/icon_hd.png");
  public static BufferedImage icon_grid = Tools.readImage("/com/g2d/studio/res/icon_grid.png");
  public static BufferedImage icon_quest = Tools.readImage("/com/g2d/studio/res/icon_quest.png");
  public static BufferedImage icon_quest_group =
      Tools.readImage("/com/g2d/studio/res/icon_quest_group.png");

  public static BufferedImage icon_res_1 = Tools.readImage("/com/g2d/studio/res/icon_res_1.png");
  public static BufferedImage icon_res_2 = Tools.readImage("/com/g2d/studio/res/icon_res_2.png");
  public static BufferedImage icon_res_3 = Tools.readImage("/com/g2d/studio/res/icon_res_3.png");
  public static BufferedImage icon_res_4 = Tools.readImage("/com/g2d/studio/res/icon_res_4.png");
  public static BufferedImage icon_res_5 = Tools.readImage("/com/g2d/studio/res/icon_res_5.png");
  public static BufferedImage icon_res_6 = Tools.readImage("/com/g2d/studio/res/icon_res_6.png");
  public static BufferedImage icon_res_7 = Tools.readImage("/com/g2d/studio/res/icon_res_7.png");
  public static BufferedImage icon_res_8 = Tools.readImage("/com/g2d/studio/res/icon_res_8.png");
  public static BufferedImage icon_res_9 = Tools.readImage("/com/g2d/studio/res/icon_res_9.png");

  public static BufferedImage icon_quest_condition =
      Tools.readImage("/com/g2d/studio/res/icon_quest_condition.png");
  public static BufferedImage icon_quest_result =
      Tools.readImage("/com/g2d/studio/res/icon_quest_result.png");
  public static BufferedImage icon_quest_event =
      Tools.readImage("/com/g2d/studio/res/icon_quest_event.png");

  public static BufferedImage icon_action = Tools.readImage("/com/g2d/studio/res/icon_action.png");
  public static BufferedImage icon_camera = Tools.readImage("/com/g2d/studio/res/icon_camera.png");
  public static BufferedImage icon_layer = Tools.readImage("/com/g2d/studio/res/icon_layer.png");
  public static BufferedImage icon_affect = Tools.readImage("/com/g2d/studio/res/icon_affect.png");
  public static BufferedImage icon_talk = Tools.readImage("/com/g2d/studio/res/icon_talk.png");

  public static BufferedImage icon_condition =
      Tools.readImage("/com/g2d/studio/res/icon_condition.png");
  public static BufferedImage icon_run = Tools.readImage("/com/g2d/studio/res/icon_run.png");
  public static BufferedImage icon_scene = Tools.readImage("/com/g2d/studio/res/icon_scene.png");
  public static BufferedImage icon_trigger =
      Tools.readImage("/com/g2d/studio/res/icon_trigger.png");
  public static BufferedImage icon_event = Tools.readImage("/com/g2d/studio/res/icon_event.png");

  public static BufferedImage icon_scene_graph =
      Tools.readImage("/com/g2d/studio/res/icon_scene_graph.png");

  //	---------------------------------------------------------------------------------------------------------------
  //	icons
  public static BufferedImage icons_bar[] = clipImage("/com/g2d/studio/res/icons_bar.png", 10, 1);
  public static BufferedImage icons_tool_bar[] =
      clipImage("/com/g2d/studio/res/icons_tool_bar.png", 3, 1);
  public static BufferedImage icon_refresh =
      Tools.readImage("/com/g2d/studio/res/icon_refresh.png");

  //	---------------------------------------------------------------------------------------------------------------
  //	images
  public static BufferedImage img_splash = Tools.readImage("/com/g2d/studio/res/splash.jpg");

  public static BufferedImage img_item_info =
      Tools.readImage("/com/g2d/studio/res/img_item_info.png");
  public static BufferedImage img_quest_info =
      Tools.readImage("/com/g2d/studio/res/img_quest_info.png");
  public static BufferedImage img_quest_info2 =
      Tools.readImage("/com/g2d/studio/res/img_quest_info2.png");
  public static BufferedImage img_npc_bank =
      Tools.readImage("/com/g2d/studio/res/img_npc_bank.png");
  public static BufferedImage img_mail = Tools.readImage("/com/g2d/studio/res/img_mail.png");
  public static BufferedImage img_skill_trainer =
      Tools.readImage("/com/g2d/studio/res/img_skill_trainer.png");
  public static BufferedImage img_sell_item =
      Tools.readImage("/com/g2d/studio/res/img_sell_item.png");
  public static BufferedImage img_transport =
      Tools.readImage("/com/g2d/studio/res/img_transport.png");
  public static BufferedImage img_job_trainer =
      Tools.readImage("/com/g2d/studio/res/img_job_trainer.png");
  public static BufferedImage img_talk = Tools.readImage("/com/g2d/studio/res/img_talk.png");
  public static BufferedImage img_script = Tools.readImage("/com/g2d/studio/res/img_script.png");
  public static BufferedImage img_light64 = Tools.readImage("/com/g2d/studio/res/light64.png");

  //	---------------------------------------------------------------------------------------------------------------

  //	---------------------------------------------------------------------------------------------------------------

  public static BufferedImage[] clipImage(String src, int column, int row) {
    BufferedImage src_img = Tools.readImage(src);
    BufferedImage[] ret = new BufferedImage[column * row];
    int sw = src_img.getWidth() / column;
    int sh = src_img.getHeight() / row;
    int i = 0;
    for (int c = 0; c < column; c++) {
      for (int r = 0; r < row; r++) {
        ret[i] = src_img.getSubimage(c * sw, r * sh, sw, sh);
        i++;
      }
    }
    return ret;
  }
}