/// <summary>
 /// Crée le gestionnaire d'animations avec comme sprite par défaut le premier sprite de l'animation donnée.
 /// Peut également récupérer un comportement pour l'opacité de l'animation.
 /// L'animation est lancée une unique fois ou en boucle avec la durée indiquée, sinon celle par défaut.
 /// </summary>
 /// <param name="owner"> L'acteur associé </param>
 /// <param name="animation"> L'animation à jouer </param>
 /// <param name="loop"> Indique si l'animation est joueé en boucle </param>
 /// <param name="msLength"> Fournit une longueur de l'animation optionnelle </param>
 /// <param name="transparency"> Le paramètre d'opacité optionnel </param>
 public AnimationHandler(Actor owner, Animation animation, bool loop, int msLength = -1,
                         TransparencyHandler transparency = null) :
     base(owner, animation.GetSprite(0, owner.Orientation), transparency)
 {
     _animations = new AnimationPack(animation);
     PlayAnimation(animation, loop, msLength);
 }
Beispiel #2
0
 /// <summary>
 /// Créer l'afficheur de sprite avec l'acteur associé, son sprite et un comportement de transparence optionnel.
 /// </summary>
 /// <param name="owner"> L'acteur associé au sprite </param>
 /// <param name="defaultSprite"> Le sprite </param>
 /// <param name="transparency"> Le paramètre d'opacité </param>
 public SpriteHandler(Actor owner, CustomSprite defaultSprite, TransparencyHandler transparency = null)
 {
     Owner         = owner;
     DefaultSprite = defaultSprite;
     CurrentSprite = defaultSprite;
     Transparency  = transparency;
 }
 /// <summary>
 /// Crée le gestionnaire d'animations avec comme sprite par défaut le premier sprite de l'animation par défaut
 /// (généralement de type Stand) du pack d'animations fourni. Peut également récupérer un comportement pour
 /// l'opacité de l'animation.
 /// Par défaut, l'animation de type Birth est lancée une unique fois puis le type de l'animation par défaut du
 /// pack d'animations est mis en type d'animation par défaut.
 /// </summary>
 /// <param name="owner"> L'acteur assossié </param>
 /// <param name="animations"> Les animations de l'acteur </param>
 /// <param name="transparency"> Le paramaètre d'opacité optionnel </param>
 public AnimationHandler(Actor owner, AnimationPack animations, TransparencyHandler transparency = null) :
     base(owner, animations.DefaultAnimation.GetSprite(0, Point.Null.GetOrientation()), transparency)
 {
     _animations = animations;
     PlayAnimation(AnimationType.Birth, false);
     AnimationType = animations.DefaultAnimation.Type;
 }