You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be helpful if the MonoGame.Extended.VectorDraw.PrimitiveDrawing class had optional parameters on the DrawSolidRectangle and DrawSolidCircle methods to fill the shape with the same color that is specified, along the pattern of the DrawSolidPolygon and DrawSolidEllipse methods. Currently there's no way to do this, and so you get a shape with the desired color only on the outline, and a 50% alpha fill color.
For example:
publicvoidDrawSolidRectangle(Vector2location,floatwidth,floatheight,Colorcolor,/*added optional parameter*/booloutline=true){if(!_primitiveBatch.IsReady())thrownew InvalidOperationException("BeginCustomDraw must be called before drawing anything.");
Vector2[]rectVerts=new Vector2[4]{new Vector2(0,0),new Vector2(width,0),new Vector2(width, height),new Vector2(0, height)};
DrawSolidPolygon(location, rectVerts, color,/*pass parameter through*/ outline);}
publicvoidDrawSolidCircle(Vector2center,floatradius,Colorcolor,/*add optional parameter*/booloutline=true){if(!_primitiveBatch.IsReady())thrownew InvalidOperationException("BeginCustomDraw must be called before drawing anything.");constdoubleincrement= Math.PI *2.0/CircleSegments;doubletheta=0.0;ColorcolorFill=color*(outline?0.5f:1.0f);// same fill color logic from DrawSolidPolygon()Vector2v0=center+radius*new Vector2((float)Math.Cos(theta),(float)Math.Sin(theta));theta+=increment;for(inti=1;i<CircleSegments-1;i++){Vector2v1=center+radius*new Vector2((float)Math.Cos(theta),(float)Math.Sin(theta));Vector2v2=center+radius*new Vector2((float)Math.Cos(theta+increment),(float)Math.Sin(theta+increment));
_primitiveBatch.AddVertex(v0, colorFill, PrimitiveType.TriangleList);
_primitiveBatch.AddVertex(v1, colorFill, PrimitiveType.TriangleList);
_primitiveBatch.AddVertex(v2, colorFill, PrimitiveType.TriangleList);theta+=increment;}if(outline)// skip if not outlining, as in DrawSolidPolygon()
DrawCircle(center, radius, color);}
The text was updated successfully, but these errors were encountered:
It would be helpful if the MonoGame.Extended.VectorDraw.PrimitiveDrawing class had optional parameters on the DrawSolidRectangle and DrawSolidCircle methods to fill the shape with the same color that is specified, along the pattern of the DrawSolidPolygon and DrawSolidEllipse methods. Currently there's no way to do this, and so you get a shape with the desired color only on the outline, and a 50% alpha fill color.
For example:
The text was updated successfully, but these errors were encountered: