本文整理匯總了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;
}