XNA/FNA/MonoGame/KNI 创建指定尺寸纯色 Texture2D 效果
XNA/FNA/MonoGame/KNI 创建指定尺寸纯色 Texture2D 效果
我使用的是 FNA,对其它XNA系框架其实没有试过。
一、演示

二、代码
public static Texture2D CreateSolidColorTexture2D(int width, int height, Color color)
{
var tex = new Texture2D(Nez.Core.GraphicsDevice, width, height);
var colors = new Color[width * height];
Array.Fill(colors, color, 0, width * height);
tex.SetData(colors);
return tex;
}

浙公网安备 33010602011771号