Пример #1
0
        public static Mesh2D CreateRect(Rectangle rect, Vector2 texMin, Vector2 texMax)
        {
            var mesh = new Mesh2D(4, 6);

            mesh.AddRect(ref rect, texMin, texMax, Color4.White);
            mesh.Update();
            return(mesh);
        }
Пример #2
0
        public static Mesh2D CreateRect(Rectangle rect)
        {
            var mesh = new Mesh2D(4, 6);

            mesh.AddRect(ref rect, Vector2.Zero, Vector2.One, Color4.White);
            mesh.Update();
            return(mesh);
        }
Пример #3
0
        public DrawBatch2D()
        {
            if (defaultTexture == null)
            {
                defaultTexture  = new Texture2D(1, 1, new Color4[] { Color4.White });
                defaultMaterial = new Material(new Shader(Shader.Basic2D));
            }

            mesh      = new Mesh2D();
            draw.Mesh = mesh;
        }