public override void Animate(int time) { if (KeyFrames.Count() <= 1) { return; } AnimationFrame animationFrame = AnimationFrameForTime(time) as AnimationFrame; // Store the current transform // Point tempTransform = new Point(View.X, View.Y); // Reset rotation to 0 to avoid warping //View.Transform = CGAffineTransform.MakeRotation(0); // View.Rotation = 0; View.SetX(Convert.ToSingle(animationFrame.Frame.X)); View.SetY(Convert.ToSingle(animationFrame.Frame.Y)); // AnimView.LayoutParameters = new ViewGroup.LayoutParams(Convert.ToInt32(animationFrame.Frame.Width), Convert.ToInt32(animationFrame.Frame.Height)); Console.WriteLine(string.Format("View: {0} X: {1} Y {2}", View.ToString(), View.GetX(), View.GetY())); // Return to original transform // View.X = tempTransform.X; // View.Y = tempTransform.Y; }
public override void Animate(int time) { if (KeyFrames.Count() <= 1) { return; } AnimationFrame animationFrame = AnimationFrameForTime(time) as AnimationFrame; //AnimView.Rotation=animationFrame.Angle; }
public override void Animate(int time) { if (KeyFrames.Count() <= 1) { return; } var animationFrame = AnimationFrameForTime(time); View.Transform = CGAffineTransform.MakeRotation(animationFrame.Angle); }
public override void Animate(int time) { if (KeyFrames.Count() <= 1) { return; } var animationFrame = AnimationFrameForTime(time); View.Alpha = animationFrame.Alpha; }
public override void Animate(int time) { if (KeyFrames.Count() <= 1) { return; } AnimationFrame animationFrame = AnimationFrameForTime(time) as AnimationFrame; View.BackgroundColor = animationFrame.Color; }
public override void Animate(int time) { if (KeyFrames.Count() <= 1) { return; } AnimationFrame aFrame = (AnimationFrame)AnimationFrameForTime(time); if (aFrame.Transform == null) { return; } CATransform3D transform = CATransform3D.Identity; transform.m34 = aFrame.Transform.M34; transform = CATransform3D.MakeRotation( aFrame.Transform.Rotate.Angle, aFrame.Transform.Rotate.X, aFrame.Transform.Rotate.Y, aFrame.Transform.Rotate.Z); // Scale transform.m11 = aFrame.Transform.Scale.Sx; transform.m22 = aFrame.Transform.Scale.Sy; transform.m33 = aFrame.Transform.Scale.Sz; // Translate transform.m41 = aFrame.Transform.Translate.Tx; transform.m42 = aFrame.Transform.Translate.Ty; transform.m43 = aFrame.Transform.Translate.Tz; // transform.Rotate ( // aFrame.Transform.Rotate.Angle, // aFrame.Transform.Rotate.X, // aFrame.Transform.Rotate.Y, // aFrame.Transform.Rotate.Z); // transform.Scale ( // aFrame.Transform.Scale.Sx, // aFrame.Transform.Scale.Sy, // aFrame.Transform.Scale.Sz); // // transform.Translate ( // aFrame.Transform.Translate.Tx, // aFrame.Transform.Translate.Ty, // aFrame.Transform.Translate.Tz); this.View.Layer.Transform = transform; }
public override void Animate(int time) { if (KeyFrames.Count() <= 1) { return; } AnimationFrame animationFrame = AnimationFrameForTime(time) as AnimationFrame; // Store the current transform CGAffineTransform tempTransform = View.Transform; // Reset rotation to 0 to avoid warping View.Transform = CGAffineTransform.MakeRotation(0); View.Frame = animationFrame.Frame; // Return to original transform View.Transform = tempTransform; }