XNA Creators Club Online
Page 1 of 1 (15 items)
Sort Posts: Previous Next

Animated Sprite

Last post 06-17-2008 8:46 PM by Xenoninja. 14 replies.
  • 06-07-2008 9:27 PM

    Animated Sprite

    So...I have this GIF animation and was wondering how to add a content importer for the animatied GIF or how to set it up as an animated sprite

    BTW the animation is 146 frames and is 1024x768 in size :P 

    kinda big huh?

  • 06-07-2008 9:29 PM In reply to

    Re: Animated Sprite


    Nick Gravelyn -- Microsoft XNA MVP
    Blog | Bloc - A New Twist on the Top-Down Shooter | Next-Gen
  • 06-07-2008 9:48 PM In reply to

    Re: Animated Sprite

    Sweet, Thanks

    Although I'm using Visual Studio so I can't open the project but I can mess with the .cs files in it. :P

  • 06-08-2008 4:24 AM In reply to

    Re: Animated Sprite

    it didn't work T_T

    I compiled it into a dll and got it in my project but it crashed giving me an error like: generic error in GDI+

    other than that though it worked...just not with MY GIF (which was kinda the point...)

  • 06-13-2008 3:26 PM In reply to

    Re: Animated Sprite

    Im not sure if this is to late to post this, but there is actually a way to animate your sprite from inside the XNA framework. You can find the tutorial in the XNA help docs, under 2D Graphics. I believe though that you would have to import the texture as a strip, or sprite sheet, so having to load all those images  in your gif could be a pain. but if you have all the original images before you compiled them as a gif, there shouldn't be a problem. Just thought I would throw that out there as future reference though.
  • 06-13-2008 3:50 PM In reply to

    Re: Animated Sprite

    hehe its kinda funny you posted almost exactly 1 hour before i checked...

    but ya, i already checked into that

    since my original frames are in png and they're full size (1024x768) it takes like 3 days for visual studio to build...

    i thinks it's like someone said...png is compressed so when XNA goes to compile it uncompresses thus increasing the file size like crazy (especially cause i used the highest compression) and i not so sure that i have the RAM available to visual studio to compile such a large animation (i remember GIMP had a hard time loading all my frames at once...)

    so...my next attempt i'm gonna try converting all 145 frames to .tga since that format seems to be the smallest file size that XNA supports and w/o compression

    know of a fast way of doing that?

  • 06-13-2008 7:15 PM In reply to

    Re: Animated Sprite

    Wow, the resolution creates quite a challenge, I am a avid GIMP user as well, and coming from a pretty big 2D game art background, one thing thats always to be remembered is the format you export in. .tga format is really the most compresses format that you could use, but still, you might have problems in XNA dealing with the raw size of you .gif. im guessing that from the res, and number of your images, you most likely already up into the .mb's, So I would use this,  you can get it as a free trial, with some restrictions if I remember correctly, but it does quite a nice job. I also did a quick search for some other compressors for you to try that were free, and it seems that this program would be your best bet. Hope this helps some. As for a fast way to convert all the frames over to tga, there really is'nt one, it just takes some time exporting each individual one by hand.

     

    Hope this helps some


     http://www.creabit.com/gifcompressor/

     


  • 06-14-2008 5:59 AM In reply to

    Re: Animated Sprite

    Is there any reason why the frames must be so large?
    It'd be a bloody stupid world if people went around getting killed without dying, wouldn't it?
  • 06-14-2008 5:55 PM In reply to

    Re: Animated Sprite

    It's size is because i'm using it as an animation for my main menu

    and the number of frames comes from having 36 FPS for 4 seconds (36 * 4 = 144)

    the good news is the whole thing is a lot smaller as a whole cause i used GIMP's optimize animation thing and so all but one of the frames is about half alpha

    i still havent converted the frames to tga yet...so there still is a chance

  • 06-14-2008 5:59 PM In reply to

    Re: Animated Sprite

    EDIT

    It's size is because i'm using it as an animation for my main menu  (it's also fullscreen and i figured that 1024x768 was a good standard to use should i go to 800x600? would the quality go down too much?)

  • 06-14-2008 6:51 PM In reply to

    Re: Animated Sprite

    Your sprite sheet shouldn't be the size of the screen, just the sprites that are being animated.
    Jim Perry

    Here's what I'm up to.

    If people spent a minute searching the forums before posting I'd be out of a job.

  • 06-14-2008 9:38 PM In reply to

    Re: Animated Sprite

    the sprite is the size of the screen

    the sprite is meant to "jazz up" the background of my menu screen with an animation

  • 06-17-2008 5:17 PM In reply to

    Re: Animated Sprite

    Xenoninja:
    all but one of the frames is about half alpha
    I'm confused... GIF files can't have "half alpha"... GIF has indexed colors, and if you have alpha in your image, one of the colors on the palette is replaced with transparent pixels. In a GIF, transparency is all or nothing on any given pixel.
    It'd be a bloody stupid world if people went around getting killed without dying, wouldn't it?
  • 06-17-2008 5:20 PM In reply to