# Thread: How to Use Sprites

1. ## How to Use Sprites

Okay, I'm making a game and I want to use sprites to animate my characters. I have NO IDEA how to do this, so any help would be great. I basically need to know how to load parts of the picture as my character. Here's an example of a sprite I would like to use:
http://www.spriters-resource.com/squ...sy/6/locke.png

Moved

3. ## Re: How to Use Sprites

You would need to find out the size of a frame for the sheet (how large a single character would be, it should be the same for each character frame). Then you would need to set an offset according to the frame you want. (CharU = frameX * FrameWidth; CharV = FrameY * FrameHeight) this would get you the top left pixel in the frame if you calculated the width and height of the frames properly.

4. ## Re: How to Use Sprites

Once you have heeded BinaryCode's advice you need to decide how you are going to render to the screen. I recommend that you learn Bitblt as you can specifiy what coordinates of the picture you want to 'blt'.

Look in the FAQ for links to good tutorials.

5. ## Re: How to Use Sprites

Originally Posted by BinaryCode
You would need to find out the size of a frame for the sheet (how large a single character would be, it should be the same for each character frame). Then you would need to set an offset according to the frame you want. (CharU = frameX * FrameWidth; CharV = FrameY * FrameHeight) this would get you the top left pixel in the frame if you calculated the width and height of the frames properly.
Sorry, I'm lost. Could you explain in more detail what each of these values/variables are?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•