public void ToCaption(ICaption caption) { caption.Location = new Vector3(this.X, this.Y, 0); caption.Alpha = this.Alpha; caption.Rotate = this.Rotation; caption.FontSize = Math.Max(this.FontSize, 0.1f); caption.LineSpace = this.LineSpacing; caption.LetterSpace = this.LetterSpacing; caption.ShadowDistance = this.ShadowDistance; }
public void AddFrame(ICaption caption, double frame) { var startFrame = caption.StartFrame; var duration = caption.DurationFrame; AddSorted(this.X, startFrame, duration, frame); AddSorted(this.Y, startFrame, duration, frame); AddSorted(this.Alpha, startFrame, duration, frame); AddSorted(this.Rotation, startFrame, duration, frame); AddSorted(this.FontSize, startFrame, duration, frame); AddSorted(this.LineSpacing, startFrame, duration, frame); AddSorted(this.LetterSpacing, startFrame, duration, frame); AddSorted(this.ShadowDistance, startFrame, duration, frame); }
public static Values FromCaption(ICaption caption) { return(new Values { X = caption.Location.X, Y = caption.Location.Y, Alpha = caption.Alpha, Rotation = caption.Rotate, FontSize = caption.FontSize, LineSpacing = caption.LineSpace, LetterSpacing = caption.LetterSpace, ShadowDistance = caption.ShadowDistance, }); }
public Action <ICaption> ApplyAnimation(ICaption caption, float frame) { var value = Lerp(caption.StartFrame, caption.DurationFrame, frame); value.ToCaption(caption); return(_ => { var diff = Values.FromCaption(caption) - value; this.X.Add(diff.X); this.Y.Add(diff.Y); this.Alpha.Add(diff.Alpha); this.Rotation.Add(diff.Rotation); this.LineSpacing.Add(diff.LineSpacing); this.LetterSpacing.Add(diff.LetterSpacing); this.ShadowDistance.Add(diff.ShadowDistance); }); }
public void ToCaption(ICaption caption) { caption.Location = new Vector3(this.X, this.Y, 0); caption.Alpha = this.Alpha; caption.Rotate = this.Rotation; caption.FontSize = Math.Max(this.FontSize, 0.1f); caption.LineSpace = this.LineSpacing; caption.LetterSpace = this.LetterSpacing; caption.ShadowDistance = this.ShadowDistance; }
public static Values FromCaption(ICaption caption) { return new Values { X = caption.Location.X, Y = caption.Location.Y, Alpha = caption.Alpha, Rotation = caption.Rotate, FontSize = caption.FontSize, LineSpacing = caption.LineSpace, LetterSpacing = caption.LetterSpace, ShadowDistance = caption.ShadowDistance, }; }
public AnimationData(ICaption caption) : this() { Add(0, Values.FromCaption(caption)); Add(1, Values.FromCaption(caption)); }
public Action<ICaption> ApplyAnimation(ICaption caption, float frame) { var value = Lerp(caption.StartFrame, caption.DurationFrame, frame); value.ToCaption(caption); return _ => { var diff = Values.FromCaption(caption) - value; this.X.Add(diff.X); this.Y.Add(diff.Y); this.Alpha.Add(diff.Alpha); this.Rotation.Add(diff.Rotation); this.LineSpacing.Add(diff.LineSpacing); this.LetterSpacing.Add(diff.LetterSpacing); this.ShadowDistance.Add(diff.ShadowDistance); }; }
public void AddFrame(ICaption caption, double frame) { var startFrame = caption.StartFrame; var duration = caption.DurationFrame; AddSorted(this.X, startFrame, duration, frame); AddSorted(this.Y, startFrame, duration, frame); AddSorted(this.Alpha, startFrame, duration, frame); AddSorted(this.Rotation, startFrame, duration, frame); AddSorted(this.FontSize, startFrame, duration, frame); AddSorted(this.LineSpacing, startFrame, duration, frame); AddSorted(this.LetterSpacing, startFrame, duration, frame); AddSorted(this.ShadowDistance, startFrame, duration, frame); }
public AnimationData(ICaption caption) : this() { Add(0, Values.FromCaption(caption)); Add(1, Values.FromCaption(caption)); }
AnimationData CreateAnimationData(ICaption caption, object realCaption) { return(datas[realCaption] = new AnimationData(caption)); }
AnimationData GetAnimationData(ICaption caption, object realCaption) { return(datas.ContainsKey(realCaption) ? datas[realCaption] : null); }
AnimationData GetAnimationData(ICaption caption, object realCaption) { return datas.ContainsKey(realCaption) ? datas[realCaption] : null; }
AnimationData CreateAnimationData(ICaption caption, object realCaption) { return datas[realCaption] = new AnimationData(caption); }