コード例 #1
0
 @Override
 public void clicked(InputEvent event, float x, float y) {
   super.clicked(event, x, y);
   Overlap2DFacade facade = Overlap2DFacade.getInstance();
   ResolutionEntryVO resolutionEntryVO = new ResolutionEntryVO();
   resolutionEntryVO.name = nameVisTextField.getText();
   resolutionEntryVO.width = Integer.parseInt(widthVisTextField.getText());
   resolutionEntryVO.height = Integer.parseInt(heightVisTextField.getText());
   resolutionEntryVO.base = buttonGroup.getCheckedIndex();
   facade.sendNotification(CREATE_BTN_CLICKED, resolutionEntryVO);
 }
コード例 #2
0
  @Override
  public void onRegister() {
    super.onRegister();

    sandbox = Sandbox.getInstance();

    actionSets.put(SCENE_ACTIONS_SET, new Array<>());
    actionSets.get(SCENE_ACTIONS_SET).add(Sandbox.ACTION_PASTE);

    actionSets.put(RESOURCE_ACTION_SET, new Array<>());
    actionSets.get(RESOURCE_ACTION_SET).add(Sandbox.ACTION_DELETE);

    actionSets.put(IMAGE_RESOURCE_ACTION_SET, new Array<>());
    // actionSets.get(IMAGE_RESOURCE_ACTION_SET).add(Sandbox.ACTION_DELETE_RESOURCE);

    actionSets.put(ITEMS_ACTIONS_SET, new Array<>());
    actionSets.get(ITEMS_ACTIONS_SET).add(Sandbox.ACTION_CUT);
    actionSets.get(ITEMS_ACTIONS_SET).add(Sandbox.ACTION_COPY);
    actionSets.get(ITEMS_ACTIONS_SET).add(Sandbox.ACTION_PASTE);
    actionSets.get(ITEMS_ACTIONS_SET).add(Sandbox.ACTION_DELETE);
    actionSets.get(ITEMS_ACTIONS_SET).add(Sandbox.ACTION_GROUP_ITEMS);
    actionSets.get(ITEMS_ACTIONS_SET).add(Sandbox.ACTION_CONVERT_TO_BUTTON);

    facade = Overlap2DFacade.getInstance();
  }
コード例 #3
0
 public UIItemsTreeBox() {
   super("Items Tree", 166);
   setMovable(false);
   facade = Overlap2DFacade.getInstance();
   treeTable = new VisTable();
   treeTable.left();
   createCollapsibleWidget(treeTable);
 }
コード例 #4
0
  @Override
  public void undoAction() {
    Json json = new Json();
    CompositeVO compositeVO = json.fromJson(CompositeVO.class, backup);
    Set<Entity> newEntitiesList = PasteItemsCommand.createEntitiesFromVO(compositeVO);

    for (Entity entity : newEntitiesList) {
      Overlap2DFacade.getInstance().sendNotification(ItemFactory.NEW_ITEM_ADDED, entity);
    }

    sandbox.getSelector().setSelections(newEntitiesList, true);
  }
コード例 #5
0
ファイル: PluginManager.java プロジェクト: quabug/overlap2d
  public void initPlugin(O2DPlugin plugin) {
    if (plugins.contains(plugin)) return;

    registerPlugin(plugin);

    plugin.setAPI(this);
    plugin.setEngine(Sandbox.getInstance().getEngine());
    plugin.setFacade(Overlap2DFacade.getInstance());
    plugin.setStage(Sandbox.getInstance().getUIStage());

    plugin.initPlugin();
  }
コード例 #6
0
  @Override
  public void handleNotification(Notification notification) {
    super.handleNotification(notification);

    switch (notification.getName()) {
      case UIPhysicsProperties.CLOSE_CLICKED:
        Overlap2DFacade.getInstance()
            .sendNotification(
                Sandbox.ACTION_REMOVE_COMPONENT,
                RemoveComponentFromItemCommand.payload(
                    observableReference, PhysicsBodyComponent.class));
        break;
    }
  }
コード例 #7
0
  @Override
  public void undoAction() {
    Entity entity = EntityUtils.getByUniqueId(entityId);

    PolygonComponent polygonComponent = ComponentRetriever.get(entity, PolygonComponent.class);
    polygonComponent.vertices = dataFrom;

    // if it's image update polygon sprite data
    TextureRegionComponent textureRegionComponent =
        ComponentRetriever.get(entity, TextureRegionComponent.class);
    if (textureRegionComponent != null && textureRegionComponent.isPolygon) {
      DimensionsComponent dimensionsComponent =
          ComponentRetriever.get(entity, DimensionsComponent.class);
      dimensionsComponent.setPolygon(polygonComponent);
      textureRegionComponent.setPolygonSprite(polygonComponent);
    }

    Overlap2DFacade.getInstance().sendNotification(Overlap2D.ITEM_DATA_UPDATED, entity);
  }
コード例 #8
0
  public EditSpriteAnimationDialog() {
    super("Edit Sprite Animation Ranges");
    addCloseButton();

    facade = Overlap2DFacade.getInstance();

    VisTable mainTable = new VisTable();

    animationsList = new VisTable();
    newAnimationTable = new VisTable();

    createNewAnimationTable();

    mainTable.add(animationsList);
    mainTable.row();
    mainTable.add(newAnimationTable);
    mainTable.row();

    add(mainTable);
  }
コード例 #9
0
 @Override
 public void changed(int number) {
   Overlap2DFacade facade = Overlap2DFacade.getInstance();
   facade.sendNotification(eventName, number);
 }
コード例 #10
0
ファイル: ResourceManager.java プロジェクト: kulgan/overlap2d
 @Override
 public void onRegister() {
   super.onRegister();
   facade = Overlap2DFacade.getInstance();
   resolutionManager = facade.retrieveProxy(ResolutionManager.NAME);
 }
コード例 #11
0
 @Override
 public void onRegister() {
   super.onRegister();
   facade = Overlap2DFacade.getInstance();
 }
コード例 #12
0
 @Override
 public void changed(ChangeEvent changeEvent, Actor actor) {
   Overlap2DFacade facade = Overlap2DFacade.getInstance();
   facade.sendNotification(eventName, ((VisCheckBox) actor).isChecked());
 }
コード例 #13
0
ファイル: PluginManager.java プロジェクト: quabug/overlap2d
 public PluginManager() {
   super(NAME);
   facade = Overlap2DFacade.getInstance();
 }
コード例 #14
0
 public SandboxCommand() {
   sandbox = Sandbox.getInstance();
   facade = Overlap2DFacade.getInstance();
 }