SceneData; // An array of floats (borrowed from T"> Creating a XML List for TXB | Torque X 2D | Forums | Community | GarageGames.com

Game Development Community

Creating a XML List for TXB

by Vishal Bhanderi · in Torque X 2D · 07/23/2008 (12:39 pm) · 1 replies

Hi guys,

I'm trying to create a list that is passed to TXB using this code taken from the XML deserializer section:

// A generic, "contains anything", list:
      public List<object> SceneData;
      // An array of floats (borrowed from T2DAnimationComponent.Animation):
      public float[] CurveRange
      {
        get { return _curveRange; }
        set { _curveRange = value; _curveDirty = true; }
      }
      // A special "XML property" list (see below for an explanation):
      [TorqueXmlDeserializeInclude]
      [XmlElement(ElementName = "Forces")]
      internal List<Force> _XMLForces
      {
        get { return null; }
        set
        {
          for (int i = 0; i < value.Count; i++)
          {
            AddForce(value[i]);
          }
        }
      }

But when i try to import it, the complier dosn't like " [XmlElement" what is wrong?? Is it says its missing a reference or assembly but im not quite sure if i am actually missing one.

Thanks in advance.

#1
07/26/2008 (10:04 am)
I would really appreciate if someone would help me out here. eg define

array[0]=option1;
array[1]=option2;
array[2]=option3;

in c#

then in TXB i could see a drop down box like:

option1
option2
option3

I can't really get designing the more complex components until this is setup.

Thanks