/// <summary> /// Function used to override the default animation values defined within XamlFlair /// </summary> public static void OverrideDefaultSettings( AnimationKind kind = DefaultSettings.DEFAULT_KIND, double duration = DefaultSettings.DEFAULT_DURATION, double interElementDelay = DefaultSettings.DEFAULT_INTER_ELEMENT_DELAY, EasingType easing = DefaultSettings.DEFAULT_EASING, EasingMode mode = DefaultSettings.DEFAULT_EASING_MODE, #if __WPF__ TransformationType transformOn = DefaultSettings.DEFAULT_TRANSFORM_ON, #elif __UWP__ && !HAS_UNO double saturation = DefaultSettings.DEFAULT_SATURATION, #endif EventType @event = DefaultSettings.DEFAULT_EVENT) { DefaultSettings.Kind = kind; DefaultSettings.Duration = duration; DefaultSettings.InterElementDelay = interElementDelay; DefaultSettings.Easing = easing; DefaultSettings.Mode = mode; DefaultSettings.Event = @event; #if __WPF__ DefaultSettings.TransformOn = transformOn; #elif __UWP__ && !HAS_UNO DefaultSettings.Saturation = saturation; #endif }
protected BaseAnimatorTask(object owner, AnimationKind kind, int time, Action endCallback) { m_key = new AnimationKey(owner, kind); m_timeLeft = time; m_totalTime = time; m_endCallback = endCallback; }
public InterpolateAnimatorTask(object owner, AnimationKind kind, T valueFrom, T valueTo, int time, Action <float, T, T> tickCallback, Action callback) : base(owner, kind, time, callback) { m_start = valueFrom; m_end = valueTo; m_tickCallback = tickCallback; }
public static void Add(DependencyObject element, AnimationKind type, AnimationTimeline animation) { switch (type) { case AnimationKind.BackgroundColor: Storyboard.SetTargetProperty(animation, new PropertyPath("Background.Color")); break; case AnimationKind.BorderColor: Storyboard.SetTargetProperty(animation, new PropertyPath("(Border.BorderBrush).(SolidColorBrush.Color)")); break; case AnimationKind.BackgroundOpacity: Storyboard.SetTargetProperty(animation, new PropertyPath("Background.Opacity")); break; case AnimationKind.DropShadowOpacity: Storyboard.SetTargetProperty(animation, new PropertyPath("Effect.Opacity")); break; case AnimationKind.DropShadowBlur: Storyboard.SetTargetProperty(animation, new PropertyPath("Effect.BlurRadius")); break; case AnimationKind.Opacity: Storyboard.SetTargetProperty(animation, new PropertyPath("Opacity")); break; case AnimationKind.TranslateX: Storyboard.SetTargetProperty(animation, new PropertyPath("(UIElement.RenderTransform).(TranslateTransform.X)")); break; case AnimationKind.TranslateY: Storyboard.SetTargetProperty(animation, new PropertyPath("(UIElement.RenderTransform).(TranslateTransform.Y)")); break; case AnimationKind.Margin: Storyboard.SetTargetProperty(animation, new PropertyPath("Margin")); break; case AnimationKind.Width: Storyboard.SetTargetProperty(animation, new PropertyPath("Width")); break; case AnimationKind.Height: Storyboard.SetTargetProperty(animation, new PropertyPath("Height")); break; default: break; } Storyboard.SetTarget(animation, element); sboard.Children.Add(animation); }
public virtual void InitByEffect(EffectID effectID) { int eid = (int)effectID; EffectRec effRec = EffectsData.dbEffects[eid]; if (effRec.FrameCount > 0) { AnimKind = effRec.AnimationKind; ImagesOrigin = effRec.ImageIndex; FramesCount = (int)effRec.FrameCount; } }
static void InitializeAnimationListBoxEdit(ListBoxEdit listBoxEdit, IEnumerable <AnimationKind> animationKinds, Type defaultAnimationType) { List <AnimationKind> allAnimationKinds = new List <AnimationKind>(); listBoxEdit.ClearValue(ListBoxEdit.SelectedIndexProperty); AnimationKind noneAnimation = GetNoneAnimation(animationKinds); allAnimationKinds.Add(noneAnimation); allAnimationKinds.AddRange(animationKinds); listBoxEdit.ItemsSource = allAnimationKinds; listBoxEdit.SelectedIndex = GetDefaultAnimationIndex(allAnimationKinds, defaultAnimationType); }
public static void StartCustomAnimation(WindowObject owner, AnimationKind kind, object param, int time, Action <int, object> tick, Action callback) { if (kind != AnimationKind.None) { RemoveAnimation(owner, kind); } BaseAnimatorTask task = new CustomAnimatorTask(owner, kind, param, time, tick, callback); s_tasks.AddLast(task); ReSchedule(s_tasks.Count == 1); }
public static void StartAnimation <T>(WindowObject owner, AnimationKind kind, T valueFrom, T valueTo, int time, Action <float, T, T> tick, Action callback) { if (kind != AnimationKind.None) { RemoveAnimation(owner, kind); } BaseAnimatorTask task = new InterpolateAnimatorTask <T>(owner, kind, valueFrom, valueTo, time, tick, callback); s_tasks.AddLast(task); ReSchedule(s_tasks.Count == 1); }
public static void RemoveAnimation(WindowObject owner, AnimationKind kind = AnimationKind.None) { LinkedListNode <BaseAnimatorTask> node = s_tasks.First; while (node != null) { if (node.Value.Key.Owner == owner && (kind == AnimationKind.None || node.Value.Key.Kind == kind)) { s_tasks.Remove(node); } node = node.Next; } }
public static void Add(DependencyObject element, AnimationKind type, AnimationTimeline animation) { switch(type) { case AnimationKind.BackgroundColor: Storyboard.SetTargetProperty(animation, new PropertyPath("Background.Color")); break; case AnimationKind.BorderColor: Storyboard.SetTargetProperty(animation, new PropertyPath("(Border.BorderBrush).(SolidColorBrush.Color)")); break; case AnimationKind.BackgroundOpacity: Storyboard.SetTargetProperty(animation, new PropertyPath("Background.Opacity")); break; case AnimationKind.DropShadowOpacity: Storyboard.SetTargetProperty(animation, new PropertyPath("Effect.Opacity")); break; case AnimationKind.DropShadowBlur: Storyboard.SetTargetProperty(animation, new PropertyPath("Effect.BlurRadius")); break; case AnimationKind.Opacity: Storyboard.SetTargetProperty(animation, new PropertyPath("Opacity")); break; case AnimationKind.TranslateX: Storyboard.SetTargetProperty(animation, new PropertyPath("(UIElement.RenderTransform).(TranslateTransform.X)")); break; case AnimationKind.TranslateY: Storyboard.SetTargetProperty(animation, new PropertyPath("(UIElement.RenderTransform).(TranslateTransform.Y)")); break; case AnimationKind.Margin: Storyboard.SetTargetProperty(animation, new PropertyPath("Margin")); break; case AnimationKind.Width: Storyboard.SetTargetProperty(animation, new PropertyPath("Width")); break; case AnimationKind.Height: Storyboard.SetTargetProperty(animation, new PropertyPath("Height")); break; default: break; } Storyboard.SetTarget(animation, element); sboard.Children.Add(animation); }
static AnimationKind GetNoneAnimation(IEnumerable <AnimationKind> animationKinds) { if (animationKinds == null) { return(new AnimationKind(null, "None")); } IEnumerator <AnimationKind> enumerator = animationKinds.GetEnumerator(); enumerator.MoveNext(); AnimationKind current = enumerator.Current; if (current == null) { return(new AnimationKind(null, "None")); } else { return(new AnimationKind(current.Type, "None")); } }
public MapObject(GameSpace space, object owner) : base(space, owner) { Loops = 1; AnimKind = AnimationKind.None; }
public Anim setKind(AnimationKind kind) { this.kind = kind; return(this); }
public AnimationKey(object owner, AnimationKind kind) { Owner = owner; Kind = kind; }
public CustomAnimatorTask(object owner, AnimationKind kind, object param, int time, Action <int, object> tickCallback, Action callback) : base(owner, kind, time, callback) { m_param = param; m_tickCallback = tickCallback; }
public AnimationArgs(AnimationKind animation, object[] args) { Animation = animation; Args = args; }