XNA Basics - Sprites Part 2

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
5,994
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 22, 2009

In this tutorial, I will show you how to add a sprite to your game and display it to the game window. Part 2 of 2

Sprites resource can be found here - http://www.phstudios.com/?q=node/49

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (Whiplashx86)

  • What do you use to create your sprites?

  • @altfclansing Paper and pencil, scan as image, and finally trace with Photoshop.

  • I really like your tutorials and i have a question. You mentioned changing the origin of the sprite, and that you can change it for example, to the bottom left or the center. How do you do this?

  • Assume the texture it named ship. In the origin part of the Draw call, use this:

    new Vector2(ship.Width,ship.Height­)

  • now if we want to create our own simple sprite like this how do we get the background transparent?

  • I have mine set as a transparent PNG, but you can use TGA as well.

see all

All Comments (19)

Sign In or Sign Up now to post a comment!
  • thanks

  • What do you use to create your sprites?

  • great tutorial

  • thanks your tutorials are really simple and easy to understand (:

  • man your awesome!

  • good job

  • what is my sprite will have color as 0, 0, 0 (black) will that black be transparent?

  • Oh sorry forgot to tell you it got fixed, I just fixed the cases forgot it was case sensitive.

    It was for the case sensitive thing right :P

  • You need to use the object spriteBatch. You were using the class there.

    spriteBatch.Begin();

  • Error1An object reference is required for the non-static field, method, or property 'Microsoft.Xna.Framework.Graph­ics.SpriteBatch.Begin()'

    Quoted from the Line

    SpriteBatch.Begin();

  • Yeah I have a complete side scroller queued up for tutorial 5

  • Hey could you do some tutorials on side scrolling games and how to build them?

    Like marrio or the old Sonic games.

    It would be MUCH appreciated!

    Thanks I subbed.

  • The first part is uploaded but its still processing. If it is not finished by tomorrow I will upload it again. Sorry for the delay

  • Pretty good, kinda cut off on the ends but not bad.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more