Search in sources :

Example 1 with Tiled

use of ilargia.egdx.logicbricks.component.scene.Tiled in project Entitas-Java by Rubentxu.

the class SceneEntity method addTiled.

public SceneEntity addTiled(String tileMapName, float unitScale) {
    Tiled component = (Tiled) recoverComponent(SceneComponentsLookup.Tiled);
    if (component == null) {
        component = new Tiled();
    }
    component.tileMapName = tileMapName;
    component.unitScale = unitScale;
    addComponent(SceneComponentsLookup.Tiled, component);
    return this;
}
Also used : Tiled(ilargia.egdx.logicbricks.component.scene.Tiled)

Example 2 with Tiled

use of ilargia.egdx.logicbricks.component.scene.Tiled in project Entitas-Java by Rubentxu.

the class SceneEntity method replaceTiled.

public SceneEntity replaceTiled(String tileMapName, float unitScale) {
    Tiled component = (Tiled) recoverComponent(SceneComponentsLookup.Tiled);
    if (component == null) {
        component = new Tiled();
    }
    component.tileMapName = tileMapName;
    component.unitScale = unitScale;
    replaceComponent(SceneComponentsLookup.Tiled, component);
    return this;
}
Also used : Tiled(ilargia.egdx.logicbricks.component.scene.Tiled)

Example 3 with Tiled

use of ilargia.egdx.logicbricks.component.scene.Tiled in project Entitas-Java by Rubentxu.

the class TiledRendererSystem method initialize.

@Override
public void initialize() {
    this.cam = context.getCamera().camera;
    Tiled tiled = context.getTiled();
    TiledMap tiledMap = assetsManager.getMap(tiled.tileMapName);
    this.tiledRenderer = new OrthogonalTiledMapRenderer(tiledMap, tiled.unitScale);
}
Also used : OrthogonalTiledMapRenderer(com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer) Tiled(ilargia.egdx.logicbricks.component.scene.Tiled) TiledMap(com.badlogic.gdx.maps.tiled.TiledMap)

Example 4 with Tiled

use of ilargia.egdx.logicbricks.component.scene.Tiled in project Entitas-Java by Rubentxu.

the class TiledRendererSystem method execute.

@Override
protected void execute(List<SceneEntity> gameEntities) {
    Tiled tiled = context.getTiled();
    TiledMap tiledMap = assetsManager.getMap(tiled.tileMapName);
    tiledRenderer.setMap(tiledMap);
    tiledRenderer.setView((OrthographicCamera) cam);
}
Also used : Tiled(ilargia.egdx.logicbricks.component.scene.Tiled) TiledMap(com.badlogic.gdx.maps.tiled.TiledMap)

Aggregations

Tiled (ilargia.egdx.logicbricks.component.scene.Tiled)4 TiledMap (com.badlogic.gdx.maps.tiled.TiledMap)2 OrthogonalTiledMapRenderer (com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer)1