//=========================================================================================
        /// <summary> 
        /// In this function each derived class should read its own data from
        /// the given XML node representing this object and its attributes. Base methods should 
        /// also be called as part of this process.
        /// </summary>
        /// 
        /// <param name="data"> 
        /// An object representing the xml data for this XMLObject. Data values should be 
        /// read from here.
        /// </param>
        //=========================================================================================
        public override void ReadXml( XmlObjectData data )
        {
            // Call base class function

            base.ReadXml(data);

            data.ReadString ( "Font"    , ref m_font_name   , "Content\\Fonts\\Game_16px.xml"   );
            data.ReadBool   ( "Center"  , ref m_center      , false                             );

            // Read in font:

            m_font = new Font(m_font_name);
        }
示例#2
0
        //=========================================================================================
        /// <summary> 
        /// In this function each derived class should read its own data from
        /// the given XML node representing this object and its attributes. Base methods should 
        /// also be called as part of this process.
        /// </summary>
        /// 
        /// <param name="data"> 
        /// An object representing the xml data for this XMLObject. Data values should be 
        /// read from here.
        /// </param>
        //=========================================================================================
        public override void ReadXml( XmlObjectData data )
        {
            // Call base class function

            base.ReadXml(data);

            // Read all data:

            data.ReadTexture( "Texture"             , ref m_texture_name        , ref m_texture , "Graphics\\default"  );
            data.ReadEffect ( "Effect"              , ref m_effect_name         , ref m_effect  , "Effects\\textured"  );
            data.ReadFloat  ( "SizeX"               , ref m_size.X              , 256   );
            data.ReadFloat  ( "SizeY"               , ref m_size.Y              , 256   );
            data.ReadBool   ( "FlipHorizontal"      , ref m_flip_horizontal     , false );
            data.ReadBool   ( "FlipVertical"        , ref m_flip_vertical       , false );
            data.ReadFloat  ( "HorizontalRepeats"   , ref m_horizontal_repeats  , 1     );
            data.ReadFloat  ( "VerticalRepeats"     , ref m_vertical_repeats    , 1     );
        }
示例#3
0
        public override void ReadXml(XmlObjectData data)
        {
            base.ReadXml(data);

            data.ReadFloat("DirectionX", ref m_direction.X);

            data.ReadFloat("DirectionY", ref m_direction.Y);

            data.ReadFloat("Force", ref m_power);

            data.ReadBool("CharactersAffected", ref m_charactersAffected);

            data.ReadBool("ProjectilesAffected", ref m_projectilesAffected);

            m_box.X = (int)PositionX;

            m_box.Y = (int)PositionY;

            m_box.Width = (int)BoxDimensionsX;

            m_box.Height = (int)BoxDimensionsY;
        }
示例#4
0
        //=========================================================================================
        /// <summary> 
        /// In this function each derived class should read its own data from
        /// the given XML node representing this object and its attributes. Base methods should 
        /// also be called as part of this process.
        /// </summary>
        /// 
        /// <param name="data"> 
        /// An object representing the xml data for this XMLObject. Data values should be 
        /// read from here.
        /// </param>
        //=========================================================================================
        public override void ReadXml( XmlObjectData data )
        {
            // Call the base class function first:

            base.ReadXml(data);

            // Read the collision lines file name:

            data.ReadString( "CollisionLinesXmlFile" , ref m_collision_lines_xml_file , "Content\\CollisionLines\\default.xml" );

            // Read the scaling for the collision lines:

            data.ReadFloat( "CollisionLineScaleX" , ref m_collision_line_scale.X , 1 );
            data.ReadFloat( "CollisionLineScaleY" , ref m_collision_line_scale.Y , 1 );

            // Read this:

            data.ReadBool( "ReverseCollisionNormals" , ref m_reverse_collision_normals , false );

            // Load collision lines:

            ReadXmlCollisionLines();
        }
        //=========================================================================================
        /// <summary> 
        /// In this function each derived class should read its own data from
        /// the given XML node representing this object and its attributes. Base methods should 
        /// also be called as part of this process.
        /// </summary>
        /// 
        /// <param name="data"> 
        /// An object representing the xml data for this XMLObject. Data values should be 
        /// read from here.
        /// </param>
        //=========================================================================================
        public override void ReadXml( XmlObjectData data )
        {
            // Call base class function

            base.ReadXml(data);

            data.ReadString ( "Font"            , ref m_font_name           , "Content\\Fonts\\Game_16px.xml"   );
            data.ReadString ( "PhaseStringName" , ref m_phase_string_name   , "No_String_Specified"             );
            data.ReadString ( "ReadyStringName" , ref m_ready_string_name   , "No_String_Specified"             );
            data.ReadBool   ( "Center"          , ref m_center              , false                             );
            data.ReadFloat  ( "FontEnlarge"     , ref m_font_enlarge        , 64.0f                             );

            // Read in font:

            m_font = new Font(m_font_name);
        }
示例#6
0
        //=========================================================================================
        /// <summary> 
        /// In this function each derived class should read its own data from
        /// the given XML node representing this object and its attributes. Base methods should 
        /// also be called as part of this process.
        /// </summary>
        /// 
        /// <param name="data"> 
        /// An object representing the xml data for this XMLObject. Data values should be 
        /// read from here.
        /// </param>
        //=========================================================================================
        public override void ReadXml(XmlObjectData data)
        {
            // Call base class function

            base.ReadXml(data);

            // Read all data:

            data.ReadTexture( "Texture"     , ref m_texture_name    , ref m_texture     , "Graphics\\default"  );
            data.ReadTexture( "NormalMap"   , ref m_normal_map_name , ref m_normal_map  , "Graphics\\default"  );
            data.ReadEffect ( "Effect"      , ref m_effect_name     , ref m_effect      , "Effects\\textured"  );

            data.ReadFloat( "Rotation"          , ref m_rotation            , 0     );
            data.ReadBool ( "HorizontalFlip"    , ref m_horizontal_flip     , false );
            data.ReadBool ( "VerticalFlip"      , ref m_vertical_flip       , false );
        }