2013-07-29 64 views
1

我刚刚接触windows手机游戏开发和游戏开发,因此很可能我所要求的是以某种方式禁忌,如果让我知道的话!Windows Phone 7中的原始绘图XNA

我创建了一个适用于Windows 7.1的XNA游戏工作室项目,并且只是想要一种方法在屏幕上绘制原始形状,就像在HTML画布中一样。我已经看到这个答案here但这个答案是用户画在屏幕上,而不是我的游戏开发者,加上它不适用于XNA。看起来每个关于开始游戏开发的教程都涉及精灵和纹理,这些都很好,并且很棒,但是对于我想到的游戏的某些2D级别设计来说,看起来更像是需要做的工作。

谢谢!

回答

1

我认为你喜欢学习非常基本的图形和绘图。从开始就很好,但要记住它会有一点点沉重的学习曲线。

Here是一个很好的教程,你可以开始。

我也给了一个示例从教程,让你更好的理解。

VertexPositionColor[] vertices; 
private void SetUpVertices() 
{ 
    vertices = new VertexPositionColor[3]; 

    vertices[0].Position = new Vector3(-0.5f, -0.5f, 0f); 
    vertices[0].Color = Color.Red; 
    vertices[1].Position = new Vector3(0, 0.5f, 0f); 
    vertices[1].Color = Color.Green; 
    vertices[2].Position = new Vector3(0.5f, -0.5f, 0f); 
    vertices[2].Color = Color.Yellow; 
} 

device.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 1, VertexPositionColor.VertexDeclaration); 

这有点儿产生以下enter image description here

像显示图像,我希望我理解你的问题正确,则这个细节会为您提供您需要的答案。