/// <summary> /// 指定された色へ変化するアニメーションを開始します。 /// このメソッドは遅延実行されます。 /// </summary> /// <param name="id">関連付けられた ID。</param> /// <param name="to">変化後の色。</param> /// <param name="seconds">アニメーションが完了するまでの秒数。</param> /// <param name="easing">適用するイージング関数。</param> /// <returns>このイベントのオブジェクトを返します。</returns> public TextureEvent AnimateColor(int id, Color4 to, double seconds, Func <double, double> easing = null) { if (seconds == 0.0) { return(this); } if (seconds < 0.0) { throw new ArgumentOutOfRangeException("seconds"); } this.Storyboard.AddAction(() => { if (!this.asignment.ContainsKey(id)) { Trace.TraceWarning("Texture ID not found: " + id); return; } AnimateStoryboard story = new AnimateStoryboard(this.Window); story.AnimateColor(this.Window.Textures[this.asignment[id]], to, story.GetFrameCount(seconds), easing); this.Window.AddStoryboard(story); }); return(this); }
/// <summary> /// 指定された位置へ移動するアニメーションを開始します。 /// このメソッドは遅延実行されます。 /// </summary> /// <param name="id">関連付けられた ID。</param> /// <param name="to">移動先の位置座標。</param> /// <param name="frame">アニメーションが完了するまでのフレーム時間。</param> /// <param name="easing">適用するイージング関数。</param> /// <returns>このイベントのオブジェクトを返します。</returns> public TextureEvent AnimatePosition(int id, PointF to, int frame, Func <double, double> easing = null) { if (frame == 0) { return(this); } if (frame < 0) { throw new ArgumentOutOfRangeException("duration"); } this.Storyboard.AddAction(() => { if (!this.asignment.ContainsKey(id)) { Trace.TraceWarning("Texture ID not found: " + id); return; } AnimateStoryboard story = new AnimateStoryboard(this.Window); story.AnimatePosition(this.Window.Textures[this.asignment[id]], to, frame, easing); this.Window.AddStoryboard(story); }); return(this); }
/// <summary> /// 前景色を指定された色までアニメーション表示します。 /// このメソッドは遅延実行されます。 /// </summary> /// <param name="color">アニメーション完了時の色。</param> /// <param name="frames">アニメーションが行われるフレーム時間。</param> /// <param name="easing">適用するイージング関数。</param> /// <returns>このイベントのオブジェクトを返します。</returns> public ScreenEvent AnimateForegroundColor(Color color, int frames, Func <double, double> easing = null) { if (frames == 0) { return(this); } if (frames < 0) { throw new ArgumentOutOfRangeException("frames"); } this.Storyboard.AddAction(() => { AnimateStoryboard story = new AnimateStoryboard(this.Window); story.AnimateForeground(color, frames, easing); this.Window.AddStoryboard(story); }); return(this); }
/// <summary> /// 背景色を指定された色までアニメーション表示します。 /// このメソッドは遅延実行されます。 /// </summary> /// <param name="color">アニメーション完了時の色。</param> /// <param name="seconds">アニメーションが行われる秒数。</param> /// <param name="easing">適用するイージング関数。</param> /// <returns>このイベントのオブジェクトを返します。</returns> public ScreenEvent AnimateBackgroundColor(Color color, double seconds, Func <double, double> easing = null) { if (seconds == 0.0) { return(this); } if (seconds < 0.0) { throw new ArgumentOutOfRangeException("seconds"); } this.Storyboard.AddAction(() => { AnimateStoryboard story = new AnimateStoryboard(this.Window); story.AnimateBackground(color, story.GetFrameCount(seconds), easing); this.Window.AddStoryboard(story); }); return(this); }
/// <summary> /// 指定された色へ変化するアニメーションを開始します。 /// このメソッドは遅延実行されます。 /// </summary> /// <param name="id">関連付けられた ID。</param> /// <param name="to">変化後の色。</param> /// <param name="frame">アニメーションが完了するまでのフレーム時間。</param> /// <param name="easing">適用するイージング関数。</param> /// <returns>このイベントのオブジェクトを返します。</returns> public TextureEvent AnimateColor(int id, Color4 to, int frame, Func<double, double> easing = null) { if (frame == 0) return this; if (frame < 0) throw new ArgumentOutOfRangeException("duration"); this.Storyboard.AddAction(() => { if (!this.asignment.ContainsKey(id)) { Trace.TraceWarning("Texture ID not found: " + id); return; } AnimateStoryboard story = new AnimateStoryboard(this.Window); story.AnimateColor(this.Window.Textures[this.asignment[id]], to, frame, easing); this.Window.AddStoryboard(story); }); return this; }
/// <summary> /// 指定された位置へ移動するアニメーションを開始します。 /// このメソッドは遅延実行されます。 /// </summary> /// <param name="id">関連付けられた ID。</param> /// <param name="to">移動先の位置座標。</param> /// <param name="seconds">アニメーションが完了するまでの秒数。</param> /// <param name="easing">適用するイージング関数。</param> /// <returns>このイベントのオブジェクトを返します。</returns> public TextureEvent AnimatePosition(int id, PointF to, double seconds, Func<double, double> easing = null) { if (seconds == 0.0) return this; if (seconds < 0.0) throw new ArgumentOutOfRangeException("duration"); this.Storyboard.AddAction(() => { if (!this.asignment.ContainsKey(id)) { Trace.TraceWarning("Texture ID not found: " + id); return; } AnimateStoryboard story = new AnimateStoryboard(this.Window); story.AnimatePosition(this.Window.Textures[this.asignment[id]], to, story.GetFrameCount(seconds), easing); this.Window.AddStoryboard(story); }); return this; }
/// <summary> /// 背景色を指定された色までアニメーション表示します。 /// このメソッドは遅延実行されます。 /// </summary> /// <param name="color">アニメーション完了時の色。</param> /// <param name="frames">アニメーションが行われるフレーム時間。</param> /// <param name="easing">適用するイージング関数。</param> /// <returns>このイベントのオブジェクトを返します。</returns> public ScreenEvent AnimateBackgroundColor(Color color, int frames, Func<double, double> easing = null) { if (frames == 0) return this; if (frames < 0) throw new ArgumentOutOfRangeException("frames"); this.Storyboard.AddAction(() => { AnimateStoryboard story = new AnimateStoryboard(this.Window); story.AnimateBackground(color, frames, easing); this.Window.AddStoryboard(story); }); return this; }
/// <summary> /// 前景色を指定された色までアニメーション表示します。 /// このメソッドは遅延実行されます。 /// </summary> /// <param name="color">アニメーション完了時の色。</param> /// <param name="seconds">アニメーションが行われる秒数。</param> /// <param name="easing">適用するイージング関数。</param> /// <returns>このイベントのオブジェクトを返します。</returns> public ScreenEvent AnimateForegroundColor(Color color, double seconds, Func<double, double> easing = null) { if (seconds == 0.0) return this; if (seconds < 0.0) throw new ArgumentOutOfRangeException("seconds"); this.Storyboard.AddAction(() => { AnimateStoryboard story = new AnimateStoryboard(this.Window); story.AnimateForeground(color, story.GetFrameCount(seconds), easing); this.Window.AddStoryboard(story); }); return this; }