public void ToSwf(SwfWriter w) { w.AppendBits(0, 2); w.AppendBit(ButtonHasBlendMode); w.AppendBit(ButtonHasFilterList); w.AppendBit(ButtonStateHitTest); w.AppendBit(ButtonStateDown); w.AppendBit(ButtonStateOver); w.AppendBit(ButtonStateUp); w.AppendUI16(CharacterID); w.AppendUI16(PlaceDepth); PlaceMatrix.ToSwf(w); if (containerTag == TagType.DefineButton2) { ColorTransform.ToSwf(w, true); if (ButtonHasFilterList) { w.AppendByte((byte)FilterList.Count); for (int i = 0; i < FilterList.Count; i++) { FilterList[i].ToSwf(w); } } if (ButtonHasBlendMode) { w.AppendByte((byte)BlendMode); } } }
public void ToSwf(SwfWriter w, bool isSwf6Plus) { uint start = (uint)w.Position; w.AppendTagIDAndLength(this.TagType, 0, true); w.AppendBit(HasClipActions); w.AppendBit(HasClipDepth); w.AppendBit(HasName); w.AppendBit(HasRatio); w.AppendBit(HasColorTransform); w.AppendBit(HasMatrix); w.AppendBit(HasCharacter); w.AppendBit(Move); w.AppendUI16(Depth); if (HasCharacter) { w.AppendUI16(Character); } if (HasMatrix) { Matrix.ToSwf(w); } if (HasColorTransform) { ColorTransform.ToSwf(w, true); } if (HasRatio) { w.AppendUI16(Ratio); } if (HasName) { w.AppendString(Name); } if (HasClipDepth) { w.AppendUI16(ClipDepth); } if (HasClipActions) { ClipActions.ToSwf(w, isSwf6Plus); } //w.ResetLongTagLength(this.TagType, start, true); // this may be always long tag? if (HasClipActions || HasName) { w.ResetLongTagLength(this.TagType, start, true); // flash always makes long tags is clip actions are present } else { w.ResetLongTagLength(this.TagType, start); } }
public void ToSwf(SwfWriter w) { uint start = (uint)w.Position; w.AppendTagIDAndLength(this.TagType, 0, true); w.AppendUI16(ButtonId); ButtonColorTransform.ToSwf(w); w.ResetLongTagLength(this.TagType, start, true); }
public virtual void ToSwf(SwfWriter w) { uint start = (uint)w.Position; w.AppendTagIDAndLength(this.TagType, 0, true); w.AppendUI16(this.Character); w.AppendUI16(this.Depth); Matrix.ToSwf(w); if (HasColorTransform) { ColorTransform.ToSwf(w, false); } w.ResetLongTagLength(this.TagType, start); }
public override void ToSwf(SwfWriter w) { uint start = (uint)w.Position; w.AppendTagIDAndLength(this.TagType, 0, true); w.AppendBit(HasClipActions); w.AppendBit(HasClipDepth); w.AppendBit(HasName); w.AppendBit(HasRatio); w.AppendBit(HasColorTransform); w.AppendBit(HasMatrix); w.AppendBit(HasCharacter); w.AppendBit(Move); w.AppendBits(0, 5); // reserved w.AppendBit(PlaceFlagHasCacheAsBitmap); w.AppendBit(PlaceFlagHasBlendMode); w.AppendBit(PlaceFlagHasFilterList); w.AppendUI16(Depth); if (HasCharacter) { w.AppendUI16(Character); } if (HasMatrix) { Matrix.ToSwf(w); } if (HasColorTransform) { ColorTransform.ToSwf(w, true); } if (HasRatio) { w.AppendUI16(Ratio); } if (HasName) { w.AppendString(Name); } if (HasClipDepth) { w.AppendUI16(ClipDepth); } if (PlaceFlagHasFilterList) { w.AppendByte((byte)FilterList.Count); for (int i = 0; i < FilterList.Count; i++) { FilterList[i].ToSwf(w); } } if (PlaceFlagHasBlendMode) { w.AppendByte((byte)BlendMode); } if (HasClipActions) { //todo: ClipActions = new ClipActions(); } w.ResetLongTagLength(this.TagType, start); }