I would like to daw shapes in a pixelized style. My cirlce currently drawn with shaperenderer renders in real pixels.
but i like it to be more pixelized.
I played around with camera and viewport to get the effect, but not succeeded. I prefer to use FillViewport.
Do we need create our own drawLine funtion and draw small squares along a line? Or can this be done with Viewports whith keeping the aspect ratio?
Is there any small sample project that shows how to create simple shapes that are pixelized.
I know I can code myself, but I would like to avoid when using a framework.
In skretch you can draw a line an just specify the pixelsize, so easy.
Any hints?
public class SimpleCirleActor extends Actor {
ShapeRenderer renderer;
float radius;
public SimpleCirleActor(int x , int y, float radius) {
setBounds(0,0, Constants.pixelsPerSector(),Constants.pixelsPerSector());
this.radius = radius;
setX(x);setY(y);
renderer = new ShapeRenderer();
}
@Override
public void draw(Batch batch, float parentAlpha) {
super.draw(batch, parentAlpha);
renderer.setProjectionMatrix(getStage().getCamera().combined);
renderer.begin(ShapeRenderer.ShapeType.Line);
renderer.setColor(Color.CYAN);
float x = getX();
renderer.circle(x, getY(), radius);
renderer.end();
}
@Override
public void act(float delta) {
super.act(delta);
}
}


