当前位置: 首页>>代码示例>>C#>>正文


C# PNode.AnimateToPositionScaleRotation方法代码示例

本文整理汇总了C#中UMD.HCIL.Piccolo.PNode.AnimateToPositionScaleRotation方法的典型用法代码示例。如果您正苦于以下问题:C# PNode.AnimateToPositionScaleRotation方法的具体用法?C# PNode.AnimateToPositionScaleRotation怎么用?C# PNode.AnimateToPositionScaleRotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UMD.HCIL.Piccolo.PNode的用法示例。


在下文中一共展示了PNode.AnimateToPositionScaleRotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

		public override void Initialize() {
			long currentTime = PUtil.CurrentTimeMillis;

			// Create a new node that we will apply different activities to, and
			// place that node at location 200, 200.
			aNode = PPath.CreateRectangle(0, 0, 100, 80);
			PLayer layer = Canvas.Layer;
			layer.AddChild(aNode);
			aNode.SetOffset(200, 200);
		
			// Create a new custom "flash" activity. This activity will start running in
			// five seconds, and while it runs it will flash aNode's brush color between
			// red and green every half second.  The same effect could be achieved by
			// extending PActivity and override OnActivityStep.
			PActivity flash = new PActivity(-1, 500, currentTime + 5000);
			flash.ActivityStepped = new ActivitySteppedDelegate(ActivityStepped);

			Canvas.Root.AddActivity(flash);

			// Use the PNode animate methods to create three activities that animate
			// the node's position. Since our node already descends from the root node the
			// animate methods will automatically schedule these activities for us.
			PActivity a1 = aNode.AnimateToPositionScaleRotation(0f, 0f, 0.5f, 0f, 5000);
			PActivity a2 = aNode.AnimateToPositionScaleRotation(100f, 0f, 1.5f, 110f, 5000);
			PActivity a3 = aNode.AnimateToPositionScaleRotation(200f, 100f, 1f, 0f, 5000);

			// the animate activities will start immediately (in the next call to PRoot.processInputs)
			// by default. Here we set their start times (in PRoot global time) so that they start 
			// when the previous one has finished.
			a1.StartTime = currentTime;
		
			a2.StartAfter(a1);
			a3.StartAfter(a2);
		
			// or the previous three lines could be replaced with these lines for the same effect.
			//a2.setStartTime(currentTime + 5000);
			//a3.setStartTime(currentTime + 10000);
		}
开发者ID:malacandrian,项目名称:Piccolo.NET,代码行数:38,代码来源:ActivityExample.cs


注:本文中的UMD.HCIL.Piccolo.PNode.AnimateToPositionScaleRotation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。