dcsimg
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
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: How to Use Sprites

    Moved
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  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
  •  



Featured


Click Here to Expand Forum to Full Width