use of com.ilargia.games.logicbrick.component.TextureView in project Entitas-Java by Rubentxu.
the class CoreEntity method replaceTextureView.
public CoreEntity replaceTextureView(String name, TextureRegion texture, Vector2 position, float rotation, int height, int width) {
TextureView component = (TextureView) recoverComponent(CoreComponentsLookup.TextureView);
if (component == null) {
component = new TextureView(name, texture, position, rotation, height, width);
} else {
component.name = name;
;
component.texture = texture;
;
component.position = position;
;
component.rotation = rotation;
;
component.height = height;
;
component.width = width;
}
replaceComponent(CoreComponentsLookup.TextureView, component);
return this;
}
use of com.ilargia.games.logicbrick.component.TextureView in project Entitas-Java by Rubentxu.
the class RendererSystem method render.
@Override
public void render() {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
cam.update();
sr.setProjectionMatrix(cam.combined);
sr.begin(ShapeRenderer.ShapeType.Filled);
sr.setColor(Color.WHITE);
for (CoreEntity e : _group.getEntities()) {
View view = e.getView();
System.out.printf("..views");
if (view.shape instanceof Rectangle) {
Rectangle ret = (Rectangle) view.shape;
sr.rect(ret.x, ret.y, ret.width, ret.height);
} else {
Circle circle = (Circle) view.shape;
sr.circle(circle.x, circle.y, circle.radius);
}
}
sr.end();
batch.begin();
for (CoreEntity e : _groupScore.getEntities()) {
Score score = e.getScore();
font.draw(batch, score.text + " " + score.points, score.x, score.y);
}
for (CoreEntity e : _groupTextureView.getEntities()) {
TextureView textureView = e.getTextureView();
batch.draw(textureView.texture, textureView.position.x, textureView.position.y, 0, 0, textureView.width, textureView.height, 1, 1, textureView.rotation);
}
batch.end();
}
use of com.ilargia.games.logicbrick.component.TextureView in project Entitas-Java by Rubentxu.
the class CoreEntity method addTextureView.
public CoreEntity addTextureView(String name, TextureRegion texture, Vector2 position, float rotation, int height, int width) {
TextureView component = (TextureView) recoverComponent(CoreComponentsLookup.TextureView);
if (component == null) {
component = new TextureView(name, texture, position, rotation, height, width);
} else {
component.name = name;
;
component.texture = texture;
;
component.position = position;
;
component.rotation = rotation;
;
component.height = height;
;
component.width = width;
}
addComponent(CoreComponentsLookup.TextureView, component);
return this;
}
Aggregations