Esempio n. 1
0
        protected int m_uAtlasIndex;                    // Absolute (real) Index on the SpriteSheet

        public override void Serialize(System.IO.Stream stream)
        {
            base.Serialize(stream);
            StreamWriter sw = new StreamWriter(stream);

            CCSerialization.SerializeData(Dirty, sw);
            CCSerialization.SerializeData(IsTextureRectRotated, sw);
            CCSerialization.SerializeData(AtlasIndex, sw);
            CCSerialization.SerializeData(TextureRect, sw);
            CCSerialization.SerializeData(OffsetPosition, sw);
            sw.WriteLine(m_TextureFile == null ? "null" : m_TextureFile);
        }
Esempio n. 2
0
        /// <summary>
        /// Tells the screen to serialize its state into the given stream.
        /// </summary>
        public virtual void Serialize(Stream stream)
        {
            StreamWriter sw = new StreamWriter(stream);

            CCSerialization.SerializeData(m_bVisible, sw);
            CCSerialization.SerializeData(m_fRotationX, sw);
            CCSerialization.SerializeData(m_fRotationY, sw);
            CCSerialization.SerializeData(m_fScaleX, sw);
            CCSerialization.SerializeData(m_fScaleY, sw);
            CCSerialization.SerializeData(m_fSkewX, sw);
            CCSerialization.SerializeData(m_fSkewY, sw);
            CCSerialization.SerializeData(m_fVertexZ, sw);
            CCSerialization.SerializeData(m_bIgnoreAnchorPointForPosition, sw);
            CCSerialization.SerializeData(m_bInverseDirty, sw);
            CCSerialization.SerializeData(m_bRunning, sw);
            CCSerialization.SerializeData(m_bTransformDirty, sw);
            CCSerialization.SerializeData(m_bReorderChildDirty, sw);
            CCSerialization.SerializeData(m_uOrderOfArrival, sw);
            CCSerialization.SerializeData(m_nTag, sw);
            CCSerialization.SerializeData(m_nZOrder, sw);
            CCSerialization.SerializeData(m_obAnchorPoint, sw);
            CCSerialization.SerializeData(m_obContentSize, sw);
            CCSerialization.SerializeData(Position, sw);
            if (m_pChildren != null)
            {
                CCSerialization.SerializeData(m_pChildren.Count, sw);
                foreach (CCNode child in m_pChildren)
                {
                    sw.WriteLine(child.GetType().AssemblyQualifiedName);
                }
                foreach (CCNode child in m_pChildren)
                {
                    child.Serialize(stream);
                }
            }
            else
            {
                CCSerialization.SerializeData(0, sw); // No children
            }
        }