List of usage examples for com.badlogic.gdx.scenes.scene2d Group addActorAt
public void addActorAt(int index, Actor actor)
From source file:es.eucm.ead.editor.control.actions.editor.CreateSceneThumbnail.java
License:Open Source License
@Override public void perform(Object... args) { ModelEntity scene;// w ww . j av a 2s .com CreateThumbnailListener listener; if (args[0] instanceof ModelEntity) { scene = (ModelEntity) args[0]; EngineEntity sceneEngineEntity = entitiesLoader.toEngineEntity(scene); listener = new CreateThumbnailModelListener(sceneEngineEntity); } else { Group sceneGroup = (Group) args[0]; scene = Q.getModelEntity(sceneGroup); Group parent = sceneGroup.getParent(); int index = sceneGroup.getZIndex(); FrameBuffer frameBuffer = drawActor(sceneGroup); if (parent != null) { parent.addActorAt(index, sceneGroup); } listener = new CreateThumbnailListener(frameBuffer); } FileHandle thumbnailsFolder = assets.resolveProject(ModelStructure.THUMBNAILS_PATH); thumbnailsFolder.mkdirs(); String thumbnailPath = Q.getThumbnailPath(model.getIdFor(scene)); Thumbnail thumbnail = Q.getComponent(scene, Thumbnail.class); thumbnail.setPath(thumbnailPath); listener.thumbnailPath = thumbnailPath; controller.action(ExecuteWorker.class, StepsWorker.class, listener, STEPS, assets); }