एक ही समस्या थी, दूसरों को पहले से ही सुझाव के रूप में आप एक साथ एक वर्ग या आयत आकर्षित करने की आवश्यकता उस पर सर्कल बनावट। सर्कल बनावट रनटाइम बनाने के लिए यहां मेरी विधि का पालन किया गया है। ऐसा करने के लिए सबसे कुशल या फैंसी तरीका नहीं है, लेकिन यह काम करता है।
Texture2D createCircleText(int radius)
{
Texture2D texture = new Texture2D(GraphicsDevice, radius, radius);
Color[] colorData = new Color[radius*radius];
float diam = radius/2f;
float diamsq = diam * diam;
for (int x = 0; x < radius; x++)
{
for (int y = 0; y < radius; y++)
{
int index = x * radius + y;
Vector2 pos = new Vector2(x - diam, y - diam);
if (pos.LengthSquared() <= diamsq)
{
colorData[index] = Color.White;
}
else
{
colorData[index] = Color.Transparent;
}
}
}
texture.SetData(colorData);
return texture;
}
ऐसा लगता है कि यह अच्छी तरह से काम करेगा। धन्यवाद! –