Exemplo n.º 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);
  }
Exemplo n.º 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);
    }
  }
Exemplo n.º 3
0
  private void mSpriteReleasd(Sprite sprite, DInfo dinfo) {
    sprite.setTranslateX(dinfo.getInt(K_X2));
    sprite.setTranslateY(dinfo.getInt(K_Y2));

    sprite.setEffect(null);
  }
Exemplo n.º 4
0
 private void mSpriteDragged(Sprite sprite, DInfo dinfo) {
   sprite.setTranslateX(dinfo.getInt(K_X2));
   sprite.setTranslateY(dinfo.getInt(K_Y2));
 }