I have tried several solutions for drawing circles to generated coordinates.
It is not working, but I do not know what is the problem with filledCircle method? How can I replace it?
Message:
FilledCircle cannot be resolved or is not a field
Code:
package com.example.game;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
public class MainClass extends ApplicationAdapter {
SpriteBatch batch;
OrthographicCamera camera;
ShapeRenderer shapeRenderer;
private Sprite sprite;
@Override
public void create () {
shapeRenderer = new ShapeRenderer();
batch = new SpriteBatch();
}
@Override
public void render () {
Gdx.gl.glClearColor(1, 1, 1, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
Gdx.gl.glEnable(GL20.GL_BLEND);
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
Gdx.gl.glDisable(GL20.GL_BLEND);
batch.setProjectionMatrix(camera.combined);
batch.begin();
batch.draw(sprite, 200, 200, 64, 64);
shapeRenderer.begin(ShapeType.FilledCircle);
shapeRenderer.filledCircle(50, 50, 32);
shapeRenderer.setColor(Color.BLACK);
shapeRenderer.end();
batch.end();
}
}
Thanks in advance!