2013-07-29 65 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

像顯示圖像,我希望我理解你的問題正確,則這個細節會爲您提供您需要的答案。