use of games.rednblack.editor.proxy.ResourceManager in project HyperLap2D by rednblackgames.
the class UIParticleEffectsTabMediator method initList.
@Override
protected void initList(String searchText) {
particlesList.clear();
ResourceManager resourceManager = facade.retrieveProxy(ResourceManager.NAME);
if (new TalosItemType().getTypeId() == TalosItemType.TALOS_TYPE) {
createParticleResources(resourceManager.getProjectTalosList().keySet(), TalosResource.class, ItemFactory.get()::tryCreateTalosItem, searchText);
}
createParticleResources(resourceManager.getProjectParticleList().keySet(), ParticleEffectResource.class, ItemFactory.get()::tryCreateParticleItem, searchText);
particlesList.sort();
viewComponent.setItems(particlesList);
}
use of games.rednblack.editor.proxy.ResourceManager in project HyperLap2D by rednblackgames.
the class UIAnimationsTabMediator method initList.
@Override
protected void initList(String searchText) {
animationBoxes.clear();
ResourceManager resourceManager = facade.retrieveProxy(ResourceManager.NAME);
if (new SpineItemType().getTypeId() == SpineItemType.SPINE_TYPE) {
createAnimationResources(resourceManager.getProjectSpineAnimationsList().keySet(), SpineResource.class, ItemFactory.get()::createSpineAnimation, searchText);
}
createAnimationResources(resourceManager.getProjectSpriteAnimationsList().keySet(), SpriteResource.class, ItemFactory.get()::createSpriteAnimation, searchText);
animationBoxes.sort();
viewComponent.setThumbnailBoxes(animationBoxes);
}
use of games.rednblack.editor.proxy.ResourceManager in project HyperLap2D by rednblackgames.
the class ResourceListAdapter method createView.
@Override
protected VisTable createView(String item) {
ResourceManager rm = HyperLap2DFacade.getInstance().retrieveProxy(ResourceManager.NAME);
VisTable table = new VisTable();
table.left();
Image icon = new Image(new TextureRegionDrawable(rm.getTextureRegion(item)), Scaling.contain, Align.center);
table.add(icon).width(45).height(45);
table.add(new VisLabel(item)).padLeft(10).row();
return table;
}
use of games.rednblack.editor.proxy.ResourceManager in project HyperLap2D by rednblackgames.
the class ItemFactory method createLabel.
public int createLabel(TextTool textSettings, Vector2 position) {
ComponentFactory.InitialData data = Pools.obtain(ComponentFactory.InitialData.class);
if (!setEssentialData(data, position)) {
Pools.free(data);
return -1;
}
HyperLap2DFacade facade = HyperLap2DFacade.getInstance();
ResourceManager resourceManager = facade.retrieveProxy(ResourceManager.NAME);
resourceManager.prepareEmbeddingFont(textSettings.getFontFamily(), textSettings.getFontSize(), false);
Object[] params = new Object[5];
params[0] = "LABEL";
params[1] = textSettings.getFontFamily();
params[2] = textSettings.getFontSize();
params[3] = false;
params[4] = false;
data.data = params;
int entity = entityFactory.createEntity(sandbox.getCurrentViewingEntity(), EntityFactory.LABEL_TYPE, data);
HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ACTION_CREATE_ITEM, entity);
Pools.free(data);
return entity;
}
use of games.rednblack.editor.proxy.ResourceManager in project HyperLap2D by rednblackgames.
the class SceneControlMediator method initScene.
public void initScene(String sceneName) {
ResolutionManager resolutionManager = facade.retrieveProxy(ResolutionManager.NAME);
ResourceManager resourceManager = facade.retrieveProxy(ResourceManager.NAME);
ScreenViewport viewport = new ScreenViewport();
float sandboxUpp = Sandbox.getInstance().getUIStage().getUIScaleDensity();
float upp = 1f / resourceManager.getProjectVO().pixelToWorld * sandboxUpp;
viewport.setUnitsPerPixel(upp);
currentSceneVo = sceneLoader.loadScene(sceneName, viewport);
rootSceneVO = new CompositeItemVO(currentSceneVo.composite);
Sandbox.getInstance().getEngine().process();
}
Aggregations