Results 1 to 5 of 5

Thread: How to Use Sprites

  1. #1

    Thread Starter
    New Member riffz's Avatar
    Join Date
    Apr 2007
    Location
    Canada
    Posts
    9

    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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: How to Use Sprites

    Moved

  3. #3
    Junior Member
    Join Date
    Mar 2007
    Location
    New Jersey
    Posts
    30

    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.
    Final Fantasy Tactics Online
    Blank Engine (3D, Opensource, VB Engine)(Under construction but does have a download)

  4. #4
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    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.
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

  5. #5

    Thread Starter
    New Member riffz's Avatar
    Join Date
    Apr 2007
    Location
    Canada
    Posts
    9

    Re: How to Use Sprites

    Quote 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
  •  



Click Here to Expand Forum to Full Width