Search in sources :

Example 1 with ResourceManager

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);
}
Also used : TalosItemType(games.rednblack.h2d.extension.talos.TalosItemType) ResourceManager(games.rednblack.editor.proxy.ResourceManager)

Example 2 with ResourceManager

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);
}
Also used : SpineItemType(games.rednblack.h2d.extension.spine.SpineItemType) ResourceManager(games.rednblack.editor.proxy.ResourceManager)

Example 3 with ResourceManager

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;
}
Also used : VisTable(com.kotcrab.vis.ui.widget.VisTable) TextureRegionDrawable(com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable) VisLabel(com.kotcrab.vis.ui.widget.VisLabel) ResourceManager(games.rednblack.editor.proxy.ResourceManager) Image(com.badlogic.gdx.scenes.scene2d.ui.Image)

Example 4 with ResourceManager

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;
}
Also used : ComponentFactory(games.rednblack.editor.renderer.factory.component.ComponentFactory) ResourceManager(games.rednblack.editor.proxy.ResourceManager) HyperLap2DFacade(games.rednblack.editor.HyperLap2DFacade)

Example 5 with ResourceManager

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();
}
Also used : CompositeItemVO(games.rednblack.editor.renderer.data.CompositeItemVO) ResolutionManager(games.rednblack.editor.proxy.ResolutionManager) ResourceManager(games.rednblack.editor.proxy.ResourceManager) ScreenViewport(com.badlogic.gdx.utils.viewport.ScreenViewport)

Aggregations

ResourceManager (games.rednblack.editor.proxy.ResourceManager)11 ShaderComponent (games.rednblack.editor.renderer.components.ShaderComponent)2 OrthographicCamera (com.badlogic.gdx.graphics.OrthographicCamera)1 TextureAtlas (com.badlogic.gdx.graphics.g2d.TextureAtlas)1 Actor (com.badlogic.gdx.scenes.scene2d.Actor)1 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)1 TextureRegionDrawable (com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable)1 ScreenViewport (com.badlogic.gdx.utils.viewport.ScreenViewport)1 VisLabel (com.kotcrab.vis.ui.widget.VisLabel)1 VisTable (com.kotcrab.vis.ui.widget.VisTable)1 HyperLap2DFacade (games.rednblack.editor.HyperLap2DFacade)1 DeleteImageResource (games.rednblack.editor.controller.commands.resource.DeleteImageResource)1 ProjectManager (games.rednblack.editor.proxy.ProjectManager)1 ResolutionManager (games.rednblack.editor.proxy.ResolutionManager)1 CompositeItemVO (games.rednblack.editor.renderer.data.CompositeItemVO)1 MainItemVO (games.rednblack.editor.renderer.data.MainItemVO)1 ProjectInfoVO (games.rednblack.editor.renderer.data.ProjectInfoVO)1 ComponentFactory (games.rednblack.editor.renderer.factory.component.ComponentFactory)1 Sandbox (games.rednblack.editor.view.stage.Sandbox)1 DraggableResource (games.rednblack.editor.view.ui.box.resourcespanel.draggable.DraggableResource)1