0
\$\begingroup\$

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?

\$\endgroup\$
0

1 Answer 1

1
\$\begingroup\$

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

See: Automatic XNB serialization in XNA Game Studio 3.1

See also: Shawn Hargreaves Blog Index: Content Pipeline

\$\endgroup\$
1
  • \$\begingroup\$ 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. \$\endgroup\$
    – Grofit
    Commented Feb 5, 2012 at 12:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .