Nez.Portable/Graphics/Graphics.cs
/// <summary>
/// helper method that generates a single color texture of the given dimensions
/// </summary>
/// <returns>The single color texture.</returns>
/// <param name="width">Width.</param>
/// <param name="height">Height.</param>
/// <param name="color">Color.</param>
helper method that generates a single color texture of the given dimensions
helper method that generates a single color texture of the given dimensions
public static Texture2D createSingleColorTexture(int width, int height, Color color)
        {
            var texture = new Texture2D(Core.graphicsDevice, width, height);
            var data = new Color[width * height];
            for (var i = 0; i < data.Length; i++)
                data[i] = color;
            texture.SetData<Color>(data);
            return texture;
        }
public static Texture2D createSingleColorTexture ( int width , int height , Color color ) { var texture = new Texture2D ( Core . graphicsDevice , width , height ) ; var data = new Color [ width * height ] ; for ( var i = 0 ; i < data . Length ; i ++ ) data [ i ] = color ; texture . SetData < Color > ( data ) ; return texture ; }
helper method that generates a single color texture of the given dimensions
helper method that generates a single color texture of the given dimensions
The single color texture.
The single color texture .
width
int
None
height
int
None
color
Color
None