Well, the first blog post in the blog Garden (I ordered a blog post to import wordpress. There is no news here =)
Let's first introduce the background. I used Pygame to write a semi-finished game in Python. I felt that the weak type of Python caused a problem in the expansion of the Code Scale (in fact, it was impossible to be lazy without automation ~)
I have a book about XNA, so I plan to migrate it to XNA.
XNA should have been abandoned. Now we can only find XNA Game Studio 4 and only support VS2010.
So I had to install Visual C #2010 Express first (why should I discard the beautiful UI of 2013)
Wait for completion
---------------------------------------------------------------------
Ah, it's finished.
Then download XNA Game Studio 4
Sit wait
---------------------------------------------------------------------
Create a win32 xna Project
Add resources in GameContent
Load Resources
1 texture = Content.Load<Texture2D>(@"Image\Ground");
Draw and center
1 protected override void Draw(GameTime gameTime) 2 { 3 GraphicsDevice.Clear(Color.CornflowerBlue); 4 spriteBatch.Begin(); 5 6 spriteBatch.Draw(texture, 7 new Vector2( 8 Window.ClientBounds.Width / 2 - texture.Width / 2, 9 Window.ClientBounds.Height / 2 - texture.Height / 210 ), Color.White);11 12 spriteBatch.End();13 base.Draw(gameTime);14 }
It's easy. = I never wrote this article.