本文整理匯總了C#中Animation.addFrame方法的典型用法代碼示例。如果您正苦於以下問題:C# Animation.addFrame方法的具體用法?C# Animation.addFrame怎麽用?C# Animation.addFrame使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Animation
的用法示例。
在下文中一共展示了Animation.addFrame方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SwordSwing
public SwordSwing(Unit unit, Texture2D texture)
{
this.anchor = unit;
Animation animation = new Animation(texture, 0.1f, false);
animation.addFrame( new Rectangle(0, 0, 8, 8) );
animation.addFrame( new Rectangle(8, 0, 8, 8) );
Offset = new Vector2(0, 50);
sprite.PlayAnimation(animation);
}
示例2: LoadAnimations
private void LoadAnimations()
{
Texture2D texture = GameManager.TheGameManager.Content.Load<Texture2D>(Path.Textures.Units + "slime");
Animation animation = new Animation(texture, 0.08f, false);
animation = new Animation(texture, 0.16f, true);
animation.addFrame(new Rectangle(0, 0, 32, 32));
animation.addFrame(new Rectangle(32, 0, 32, 32));
Animations.Add("walking", animation);
// Calculate bounds within texture size.
base.localBounds = new Rectangle(0, 0, 32, 32);
sprite.PlayAnimation(Animations["walking"]);
}