use of com.badlogic.gdx.graphics.g2d.Batch in project Entitas-Java by Rubentxu.
the class MatchOneState method initialize.
@Override
public void initialize() {
entitas = new Entitas();
EntityIndexExtension.addEntityIndices(entitas);
// Input
World physics = engine.getManager(BasePhysicsManager.class).getPhysics();
BodyBuilder bodyBuilder = engine.getManager(BasePhysicsManager.class).getBodyBuilder();
Camera camera = engine.getManager(BaseSceneManager.class).getDefaultCamera();
Batch batch = engine.getManager(BaseSceneManager.class).getBatch();
EmitInputSystem emitInputSystem = new EmitInputSystem(entitas.input, physics, camera);
systems.add(new ProcessInputSystem(entitas)).add(new GameBoardSystem(entitas.game)).add(new FallSystem(entitas.game)).add(new FillSystem(entitas.game)).add(new ScoreSystem(entitas)).add(new RemoveViewSystem(entitas.game, physics)).add(new AddViewSystem(entitas.game, assetsManager, bodyBuilder)).add(new AnimatePositionSystem(entitas.game)).add(new DestroySystem(entitas.game)).add(new RendererSystem(entitas, camera, batch, physics));
}
use of com.badlogic.gdx.graphics.g2d.Batch in project bladecoder-adventure-engine by bladecoder.
the class SceneList method getBgIcon.
public TextureRegion getBgIcon(String atlas, String region) {
// context lost in new project thread
if (disposeBgCache) {
dispose();
disposeBgCache = false;
}
String s = atlas + "#" + region;
TextureRegion icon = bgIconCache.get(s);
if (icon == null) {
Batch batch = getStage().getBatch();
batch.end();
try {
icon = createBgIcon(atlas, region);
} catch (Exception e) {
EditorLogger.error("Error creating Background icon: " + atlas + "." + region);
}
if (icon == null) {
EditorLogger.error("Error creating Background icon: " + atlas + "." + region);
icon = Ctx.assetManager.getIcon("ic_no_scene");
}
bgIconCache.put(s, icon);
batch.begin();
}
return icon;
}
use of com.badlogic.gdx.graphics.g2d.Batch in project var3dframe by Var3D.
the class VStage method draw.
public void draw() {
if (bgList.size() != 0) {
Batch batch = getBatch();
batch.begin();
batch.setColor(1, 1, 1, 1);
for (Actor bg : bgList) {
float prefx = bg.getX();
float prefy = bg.getY();
bg.setPosition(bg.getX() + getRoot().getX() - cutWidth, bg.getY() + getRoot().getY() - cutHeight);
bg.draw(batch, getRoot().getColor().a);
bg.setPosition(prefx, prefy);
}
batch.end();
}
super.draw();
}
use of com.badlogic.gdx.graphics.g2d.Batch in project Eidolons by IDemiurge.
the class ChainedStage method draw.
@Override
public void draw() {
final Matrix4 combined = getCamera().combined.cpy();
getCamera().update();
final Group root = getRoot();
if (!root.isVisible())
return;
combined.setToOrtho2D(0, 0, GdxMaster.getWidth(), GdxMaster.getHeight());
Batch batch = this.getBatch();
batch.setProjectionMatrix(combined);
batch.begin();
root.draw(batch, 1);
batch.end();
}
use of com.badlogic.gdx.graphics.g2d.Batch in project Eidolons by IDemiurge.
the class EmitterController method add.
public void add(String presetPath, String imagePath) {
EmitterActor actor = null;
try {
actor = new EmitterActor(presetPath, true) {
@Override
public void draw(Batch batch, float parentAlpha) {
act(Gdx.graphics.getDeltaTime());
// Vector2 v = GridMaster.getMouseCoordinates();
// setPosition(v.x, v.y);
super.draw(batch, parentAlpha);
}
};
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
return;
}
if (imagePath != null) {
actor.getEffect().setImagePath(imagePath);
}
add(actor, null);
}
Aggregations