📜  如何在 monogame 中绘制一个矩形 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:18.446000             🧑  作者: Mango

代码示例1
Texture2D rect = new Texture2D(graphics.GraphicsDevice, 80, 30);

 Color[] data = new Color[80*30];
 for(int i=0; i < data.Length; i++) data[i] = Color.Chocolate;
 rect.SetData(data);

 Vector2 coor = new Vector2(10, 20);
 spriteBatch.Draw(rect, coor, Color.White);