How do I draw lines using XNA?

后端 未结 10 1233
情书的邮戳
情书的邮戳 2020-12-05 04:19

I\'ve read a bunch of tutorials involving XNA (and it\'s various versions) and I still am a little confused on drawing primitives. Everything seems to be really convoluted.

10条回答
  •  萌比男神i
    2020-12-05 04:34

    Well, you can do it in a very simple way without getting into the 3D horrible vector stuff.

    Just create a quick texture, for example:

    Texture2D SimpleTexture = new Texture2D(GraphicsDevice, 1, 1, false, SurfaceFormat.Color);

    And then just draw a line using that texture:

    this.spriteBatch.Draw(SimpleTexture, new Rectangle(100, 100, 100, 1), Color.Blue);

    I hope this helps

提交回复
热议问题