예제 #1
0
        /// <summary>
        /// Creates a new <see cref="DefineMorphShapeTag"/> instance.
        /// </summary>
        /// <param name="characterId">Character id.</param>
        /// <param name="startBounds">Start bounds.</param>
        /// <param name="endBounds">End bounds.</param>
        /// <param name="offset">Offset.</param>
        /// <param name="morphFillStyles">Morph fill styles.</param>
        /// <param name="morphLineStyles">Morph line styles.</param>
        /// <param name="startEdges">Start edges.</param>
        /// <param name="endEdges">End edges.</param>
        public DefineMorphShapeTag(ushort characterId, Rect startBounds, Rect endBounds, uint offset,
                                   MorphFillStyleCollection morphFillStyles, MorphLineStyleCollection morphLineStyles, ShapeRecordCollection startEdges, ShapeRecordCollection endEdges)
        {
            this.characterId     = characterId;
            this.startBounds     = startBounds;
            this.endBounds       = endBounds;
            this.offset          = offset;
            this.morphFillStyles = morphFillStyles;
            this.morphLineStyles = morphLineStyles;
            this.startEdges      = startEdges;
            this.endEdges        = endEdges;

            this._tagCode = (int)TagCodeEnum.DefineMorphShape;
        }
예제 #2
0
        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            RecordHeader rh = new RecordHeader();

            rh.ReadData(binaryReader);

            characterId = binaryReader.ReadUInt16();
            binaryReader.SynchBits();

            startBounds = new Rect();
            startBounds.ReadData(binaryReader);

            binaryReader.SynchBits();
            endBounds = new Rect();
            endBounds.ReadData(binaryReader);
            binaryReader.SynchBits();

            offset = binaryReader.ReadUInt32();

            morphFillStyles = new MorphFillStyleCollection();
            morphFillStyles.ReadData(binaryReader);

            morphLineStyles = new MorphLineStyleCollection();
            morphLineStyles.ReadData(binaryReader);

            ShapeWithStyle.NumFillBits = (uint)morphFillStyles.Count;
            ShapeWithStyle.NumLineBits = (uint)morphLineStyles.Count;

            startEdges = new ShapeRecordCollection();
            startEdges.ReadData(binaryReader, ShapeType.None);

            ShapeWithStyle.NumFillBits = (uint)morphFillStyles.Count;
            ShapeWithStyle.NumLineBits = (uint)morphLineStyles.Count;

            endEdges = new ShapeRecordCollection();
            endEdges.ReadData(binaryReader, ShapeType.None);
        }