A
A
Andrey Andryushchenko2015-05-04 07:58:18
Java
Andrey Andryushchenko, 2015-05-04 07:58:18

How to create a round ChainShape?

How in libgdx, using ChainShape, to create a round shape? No, the usual CircleShape will not work for me, because. i want to create round borders of objects spreading. That is, I need to make it so that the form is a closed loop in the shape of a circle with empty space inside it.
9ab568784dfd490794444588e62670ee.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Olenev, 2015-05-04
@agent10

1) Judging by your previous question (about drawing PolygonShape through SpriteBatch), you approached the solution on the wrong side in my opinion.
A quick look at the dock shows that PolygonShape or CircleShape and others are box2d classes and they are more needed to define the boundaries of the object (for future collision detected), but not to draw them on the screen.
Perhaps it makes sense to define your lightweight classes responsible for the geometry of the shapes.
2) How do you draw a CircleShape? Via ShapeRenderer? Look, there are two methods begin() and begin(ShapeRenderer.ShapeType type). Where type can be Filled, Line, Point. Perhaps if you set begin(Line), then your circle will not be filled.
In general, an example of your code would be helpful..
ChainShape is probably the same story as CircleShape..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question