You can’t use that Circle structure as if it were a rectangle.
Just make sure that your texture represents a circle and draw it like you would normally do: spriteBatch.Draw(myCircleTexture, myRectangle, myColor);
@luki I’m answering the original question in regard to ShapeBatch since it’s been referenced in this thread.
The Circle struct you are talking about is an “implicit shape”; a shape defined by mathematical function. In this case the function is r^2 = x^2 + y^2, where r is the radius and x and y are the centre position of the circle.
To draw things in OpenGL, DirectX, etc you need to use an “explicit shape” which is defined by vertices with each a position attribute. These vertices need to be “uploaded” to the GPU using a vertex buffer and one of the primitive types which define the topology and ordering of vertices in the vertex buffer. So what you are asking for is the ability to go from an “implicit” shape to an “explicit” shape on the fly and draw the explicit shape to the screen; a not so easy task!
SpriteBatch can only do textured rectangles (quadrilaterals) on the fly using two triangles with PrimitiveType.TriangleList (4 vertices, 6 indices).
To draw a circle on the fly you either need to use a texture of a circle and draw it as a sprite (textured quadrilateral) using SpriteBatch, or create the vertices for the circle and draw them using one of the GraphicsDevice.Draw...Primitives() methods. Unfortunately, the latter prevents you from using the SpriteBatch API for streaming dynamic textured vertices and the former does not have good performance if you want to draw different type of shapes beyond just circles and rectangles since you would need a separate texture for each shape. It’s for these reasons I am working on ShapeBatch over at MonoGame.Extended.
ShapeBatch will (eventually) be able to do everything SpriteBatch can do and more. It will be able to draw sprites, strings (from bitmap fonts too), rectangles, arcs, circles, polygons, etc.
Thank you very much for help!
I almost solved this problem, I create method, what create Texture circle and “form” circle with use class, what is at the beginning of the topic. I have problem with checking colisions yet, but I think that I to make it. I should have more time now, so I will try this make.