Blog'A'Little

Just another C# guy

2D Animation Content Pipeline

During my stay in Turkey for the Xna workshop I created a simple content importer that makes it easier to work with 2D animations. Very often you see people use spritesheets as the solution for animating 2D, which is of course not a bad way, it is a very optimal way to do things. I’ve always liked the simplicity of working with single frames, at least while I’m working on a solution, that way I can easily change stuff around. The content importer I created works with a simple Xml file (in fact just a serialized version of an object called SpriteAnimation), in this Xml file you can specify a base assetname as a format string, and you specify how many frames there are in the animation. The assetname must include the asset path as well.

The SpriteAnimation class is the one to use, it is also found in the content pipeline project, not exactly best practice. But it works for the demonstration purpose it was intended. :)

Using it is very simple:

image

In your draw method call the animations draw method with the spritebatch to draw into.

image

You can dowload the project from here. kick it on DotNetKicks.com kick it on GameDevKicks.com
Posted: jul 07 2008, 12:16 by Einar Ingebrigtsen | with 11 comment(s)
Filed under: ,

Comments

ugurkazdal said:

thankx.

nice we can download..

I'm downloading..

kick it on DotNetKicks.com kick it on GameDevKicks.com
# juli 7, 2008 1:39

Recent Faves Tagged With "spritesheets" : MyNetFaves said:

Pingback from  Recent Faves Tagged With "spritesheets" : MyNetFaves

kick it on DotNetKicks.com kick it on GameDevKicks.com
# august 25, 2008 7:29

jarjkm said:

zehehdhzqviocgdqmbkfeuqxvwyyog

kick it on DotNetKicks.com kick it on GameDevKicks.com
# september 11, 2008 2:24

trlbjb said:

ceguyomvpaxcetgolubxagbjzlwlcr

kick it on DotNetKicks.com kick it on GameDevKicks.com
# desember 20, 2008 11:23

william.smith61@gmail.com said:

I really like your site.Some times it has a lot of stuff.Pleae add some thing about <a href="www.debtcritic.co.uk/debt-consolidation.html">debt consolidation loans</a>,Insurance etc....

kick it on DotNetKicks.com kick it on GameDevKicks.com
# desember 30, 2009 12:27

C230 Suction Cup Mount Mio Digiwalker, C230 Lamp Headlight - 228.cmanager.org said:

Pingback from  C230 Suction Cup Mount Mio Digiwalker, C230 Lamp Headlight - 228.cmanager.org

kick it on DotNetKicks.com kick it on GameDevKicks.com
# mai 23, 2010 7:52

Isuzu Trooper Fender Floor Mats, Isuzu Trooper Radiator Fender Flares - 5.binggreen.com said:

Pingback from  Isuzu Trooper Fender Floor Mats, Isuzu Trooper Radiator Fender Flares - 5.binggreen.com

kick it on DotNetKicks.com kick it on GameDevKicks.com
# mai 25, 2010 10:04

1999 - 1988 @ Mercury Sable Airbag Light, Reflections 75 Piece Disposable Silverware Back - 129.an74.com said:

Pingback from  1999 - 1988 @ Mercury Sable Airbag Light, Reflections 75 Piece Disposable Silverware Back - 129.an74.com

kick it on DotNetKicks.com kick it on GameDevKicks.com
# mai 27, 2010 11:19

1990 - 2009 @ Aftermarket Headlights Nissan 240sx Performance, Phx Headlight Need Driver Nissan 240sx - 245.defutbolazo.com said:

Pingback from  1990 - 2009 @ Aftermarket Headlights Nissan 240sx Performance, Phx Headlight Need Driver Nissan 240sx - 245.defutbolazo.com

kick it on DotNetKicks.com kick it on GameDevKicks.com
# mai 27, 2010 1:32

1992 - 2001 @ Reset Computer 2002 Kia Sportage, V40 Stop Nokia 3310 - 258.jeepsunlimted.com said:

Pingback from  1992 - 2001 @ Reset Computer 2002 Kia Sportage, V40 Stop Nokia 3310 - 258.jeepsunlimted.com

kick it on DotNetKicks.com kick it on GameDevKicks.com
# mai 31, 2010 10:51

loan said:

Your website is very the most interesting. I loved your website a lot. Thank you.

kick it on DotNetKicks.com kick it on GameDevKicks.com
# juli 2, 2010 4:32
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Design downloaded from Free Templates - your source for free web templates