19 gennaio
XNA 2D Pie Sample
After I've seen some people asking how to do this on the forums, I decided to make a small class that allows us to draw Pies in 2D in XNA.
To use it, just create a new Pie2D object. The constructor receives parameters for the radius, angle and tessellation. These can also be modified at runtime, and the shape will be altered appropriately.
I made a sample that shows how to use this class. You can download it here: Pie2DSample.zip
A pie could be useful in 2D games for various effects, like enemy visibility area, flashlights, shields, etc.