Thread: Sprite creation

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    32

    Sprite creation

    Hi everyone.

    I need an automated way of rotating bitmaps.

    I am working on a 2D RTS... my engine is more or less working... but there's a problem when it comes to the art...
    I not an artist by I can draw pretty well, and pixel art is interesting... so, I decided to make the sprites for my game all by myself.,, the results so far are pretty nice... but I've encountered a problem...

    In my game, each unit can turn to 8 directions. I need a different animation for the following modes:
    idle - 1 frame of animation
    shootting/attacking - about 6 frames of animation
    dead - 5 frames of animation (different levels for corpse rotting)
    sneaking...

    and so on and on...

    I have no problem making my frames... but rotating each frame 8 times and then putting it in its right spot in the bitmap grid is quite annoying!!!! don't forget that for some directions I must rotate by 45, 135 or so degrees... and paintbrush simply doesn't do it.

    details:
    each bitmap holds a a grid of squares, each square is a different frame... during runtime my sprite manager knows which column and row it needs from the sprite map and it clips that...

    So basicaly... I need my program no to just rotate each "square" in the bitmap by itself... but also to keep the correct order and direction of squares in the resulting bitmap...

    WHAT TOOL CAN I USE?! I AM GETTING NUTS LOOKING IT UP!
    HELP!

  2. #2
    Registered User
    Join Date
    May 2006
    Posts
    169
    Photoshop (and probably the likes too) has a pretty easy way to record actions.
    As long as you keep your units centered at the middle of the sprite, no tweaking should be needed other than hitting the Play Action button.

    edit: I should also note that the mspaint doesn't use anti aliasing for rotation - which is another sweet feature graphic tools nowadays offer.
    Last edited by glo; 12-09-2006 at 06:18 AM.

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    You obviously do not understand how modern hardware works. Rotation is simple. You don't rotate the bitmap you rotate the quad that the bitmap/texture is bound to.

    No more rotating actual bitmaps and thank goodness b/c it was a time consuming operation.

  4. #4
    Registered User
    Join Date
    May 2006
    Posts
    169
    Well, yes, if your units are viewed from the top, there really isn't need to have 8 bitmaps for every animation set, like Bubba says.

  5. #5
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    This is someting that I need to do aswell, what code do you use to make an image rotate?

  6. #6
    Registered User
    Join Date
    May 2006
    Posts
    169
    Graphic libs have functions for rotating quads (such as opengl's glRotatef() )

  7. #7
    Registered User
    Join Date
    May 2006
    Posts
    32

    Reactions

    Thank you so much for all your responses.
    Let my clarify my problem:
    I use SDL... and all my units ARE viewed from above... I need to find a fast, cheap way to rotate my sprites... during gameplay if possible, but also to create 8 separate animations if needed.

  8. #8
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476
    Quote Originally Posted by Warlax
    Thank you so much for all your responses.
    Let my clarify my problem:
    I use SDL... and all my units ARE viewed from above... I need to find a fast, cheap way to rotate my sprites... during gameplay if possible, but also to create 8 separate animations if needed.
    You can use SDL with openGL. Or use SDL_GFX's rotoZoom.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectX 9 sprite issue
    By maxthecat in forum Game Programming
    Replies: 9
    Last Post: 05-18-2006, 04:04 AM
  2. SDL question (long)
    By yahn in forum C++ Programming
    Replies: 0
    Last Post: 04-16-2006, 08:46 PM
  3. GDI sprite (Win32 API)
    By fiff in forum C++ Programming
    Replies: 3
    Last Post: 06-22-2005, 03:08 PM
  4. Newton + Einstein were wrong!
    By Jez in forum A Brief History of Cprogramming.com
    Replies: 64
    Last Post: 12-14-2004, 02:24 PM
  5. Replies: 3
    Last Post: 05-12-2003, 05:49 PM