1
votes

I'm new to windows phone game development, and game development in general for that matter so it's very possible that what I'm asking is taboo in some way, if so let me know!

I've created a XNA game studio project for windows 7.1 and simply want a way to draw primitive shapes to the screen, much like in html canvas. I've seen this answer here but this answer is for users drawing on the screen, not me the game developer, plus it's not for XNA. It seems that every tutorial on getting started with game development involves sprites and textures, which are all fine and dandy, but seem like more work than is necessary for some of the 2D level design for the game I have in mind.

Thanks!

2

2 Answers

1
votes

I think you like to learn the very basic of graphics and drawing. It is very to good to start with but remember it will have a little bit of heavy learning curvy.

Here is wonderful tutorial you can start with.

I m also giving a sample from the tutorial to give you better understanding.

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);

This kinda generate image like show below enter image description here

I hope the I have understand your question correctly then this details will provide you a answer you needed.

0
votes

may be you should check this answer: How do I draw lines using XNA? you need some textures to draw something on the screen.