本文整理汇总了C#中Microsoft.Xna.Framework.Graphics.VertexPositionColor.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# VertexPositionColor.CopyTo方法的具体用法?C# VertexPositionColor.CopyTo怎么用?C# VertexPositionColor.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Graphics.VertexPositionColor
的用法示例。
在下文中一共展示了VertexPositionColor.CopyTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CameraTransform
/// <summary>
/// Camera transform
/// </summary>
/// <param name="source"></param>
/// <returns></returns>
protected static VertexPositionColor[] CameraTransform(VertexPositionColor[] source)
{
VertexPositionColor[] result = new VertexPositionColor[source.Length];
Vector2 cameraPosition = Camera2D.Instance.GetPosition();
source.CopyTo(result, 0);
for (int i = 0; i < result.Length; i++)
{
result[i].Position.X -= cameraPosition.X;
result[i].Position.Y -= cameraPosition.Y;
}
return result;
}
示例2: DrawColors
public virtual void DrawColors(VertexPositionColor[] colors, Vector2 location)
{
if (colors == null) throw new ArgumentNullException("colors");
VertexPositionColor[] copiedColors = new VertexPositionColor[colors.Length];
colors.CopyTo(copiedColors, 0);
this._commands.Enqueue(new ContextCommand { CommandType = CommandType.DrawColors, Vectors = new Vector2[] { location }, Addtions = new object[] { copiedColors } });
}
示例3: LineStrip
/// <summary>
/// Gets a LineStrip Primitive Parameters
/// </summary>
/// <param name="isclose"></param>
/// <param name="center"></param>
/// <param name="vertices"></param>
/// <returns></returns>
public static PrimitivePara LineStrip(bool isclose,Vector3 center, VertexPositionColor[] vertices)
{
VertexPositionColor[] v;
if (isclose)
{
v = new VertexPositionColor[vertices.Length+1];
vertices.CopyTo(v, 0);
v[vertices.Length] = vertices[0];
}
else
{
v = vertices;
}
int[] i = new int[v.Length];
for (int j = 0; j < i.Length; j++)
{
i[j] = j;
}
var temp =new PrimitivePara(v, i, vsBasePara.VS_PTypeDefault(VSType.Primitive, PrimitiveType.LineStrip));
temp.BasePara.center = center;
return temp;
}