コード例 #1
0
 /// <summary>
 /// Creates a new sword slash instance.
 /// </summary>
 /// <param name="game">Associated game object.</param>
 /// <param name="gameScreen">Screen where the element will appear.</param>
 /// <param name="texture">Texture asset which represents the sword slash.</param>
 public SwordSlash(Game game, GameScreen gameScreen, Texture2D texture)
     : base(game, gameScreen, texture)
 {
 }
コード例 #2
0
 /// <summary>
 /// Creates a new animated component instance with a single-frame animation.
 /// </summary>
 /// <param name="game">Associated game object.</param>
 /// <param name="gameScreen">Screen where the component will be presented.</param>
 /// <param name="texture">The texture which will serve as a single frame animation.</param>
 /// <remarks>Calling this constructor creates a new animation object.</remarks>
 public AnimatedComponent(Game game, GameScreen gameScreen, Texture2D texture) :
     this(game, gameScreen, new Animation(texture, new Point(texture.Width, texture.Height), new Point(1, 1),
                                          new Vector2(texture.Width, texture.Height) / 2f, false))
 {
 }