Example #1
0
        public static void WriteButtonRecordEx(this ISwfStreamWriter writer, ButtonRecordEx button)
        {
            writer.WriteUnsignedBits(button.Reserved, 2);
            writer.WriteBit(button.BlendMode.HasValue);
            writer.WriteBit(button.Filters.Count > 0);
            writer.WriteBit(button.StateHitTest);
            writer.WriteBit(button.StateDown);
            writer.WriteBit(button.StateOver);
            writer.WriteBit(button.StateUp);
            if (!button.IsEndButton)
            {
                writer.WriteUInt16(button.CharacterID);
                writer.WriteUInt16(button.PlaceDepth);
                writer.WriteMatrix(ref button.PlaceMatrix);
                writer.WriteColorTransformRGBA(button.ColorTransform);
                writer.FlushBits();

                if (button.Filters.Count > 0)
                {
                    writer.WriteFilterList(button.Filters);
                }
                if (button.BlendMode.HasValue)
                {
                    writer.WriteByte((byte)button.BlendMode.Value);
                }
            }
        }