Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have quite a lot of custom content pipeline components, and I was just wondering if under the hood XNA knows about these things when doing its magic...

Here is my scenario.

I have animation objects which basically contain 2d animation frames and timings etc, which can be loaded as self contained objects or can be embedded within other object. Now I was expecting that my CustomObjectAWriter could contain an instance to AnimationObjectAWriter and internally just call through to that to write out each animation object, i.e:

<SomeCustomObjectA>
    <SomeCustomElementA>
        ...
    </SomeCustomElementA>
    <SomeCustomElementB>
        ...
        <AnimationObjectA>
            ...
        </AnimationObjectA>
    </SomeCustomElementB>
</SomeCustomObjectA>

However as AnimationObjectAWriter has its Write method protected I am unable to access it, however I was wondering if WriteObject will know of the AnimationObjectAWriter so if I did WriteObject<AnimationObjectA>(animationObjectAInstance) would this work?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Yes that will work, although if it's just simple XML->objects you probably don't need custom writers/readers at all.

See: http://blogs.msdn.com/b/shawnhar/archive/2009/03/25/automatic-xnb-serialization-in-xna-game-studio-3-1.aspx

See also: http://www.shawnhargreaves.com/blogindex.html#contentpipeline

share|improve this answer
    
it is xml but it is not in the xna content format as it is used for non XNA frameworks too, and it is not a simple 1-1 mapping like XNA prefers, but thanks for the answer. –  Grofit Feb 5 '12 at 12:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.