예제 #1
0
  private void mSpriteCreate(DInfo dinfo) {
    Sprite sprite = new Sprite();
    sprite.setMainController(mainController);
    sprite.setName(dinfo.get(K_SPRITE_NAME));
    sprite.setLayoutX(dinfo.getInt(K_X1));
    sprite.setLayoutY(dinfo.getInt(K_Y1));

    String jsonString = dinfo.get(K_COSTUME_LIST);
    List<Map> list = JsonUtil.convertJsonStringToList(jsonString);
    try {
      JsonUtil.parseJSONStringToCostumes(sprite, list, new File(""));
    } catch (MalformedURLException ex) {
      Logger.getLogger(SpriteDialog.class.getName()).log(Level.SEVERE, null, ex);
    }

    sprite.setSpriteCostume(dinfo.getInt(K_COSTUME_CURRENT));

    mainController.getFrontStageController().addSprite(sprite, false);
  }
예제 #2
0
  private void mCostumeSync(Sprite sprite, DInfo dinfo) {
    // コスチュームを一旦全削除
    sprite.clearCostume();

    String jsonString = dinfo.get(K_COSTUME_LIST);
    List<Map> list = JsonUtil.convertJsonStringToList(jsonString);
    try {
      JsonUtil.parseJSONStringToCostumes(sprite, list, new File(""));
    } catch (MalformedURLException ex) {
      Logger.getLogger(SpriteDialog.class.getName()).log(Level.SEVERE, null, ex);
    }

    sprite.setSpriteCostume(dinfo.getInt(K_COSTUME_CURRENT));

    // 同一のスプライト編集中は即時更新
    String name = mainController.getFrontStageController().getCurrentSprite().getName();
    if (sprite.getName().equals(name)) {
      mainController.getBackStageController().showCostumes(sprite);
    }
  }
예제 #3
0
 private void mSpriteSelect(Sprite sprite, DInfo dinfo) {
   sprite.setEffect(new Shadow(4.0f, Color.valueOf(dinfo.get(K_COLOR))));
 }