public void Set(int x, int y, string name, float scaleX = 1f, float scaleY = 1f)
 {
     if (string.IsNullOrEmpty(name))
     {
         return;
     }
     AnimatedTilesBank.Animation animation = this.Bank.AnimationsByName[name];
     (this.tiles[x, y] ?? (this.tiles[x, y] = new List <AnimatedTiles.Tile>())).Add(new AnimatedTiles.Tile()
     {
         AnimationID = animation.ID,
         Frame       = (float)RandomUtil.Random.Next(animation.Frames.Length),
         Scale       = new Vector2(scaleX, scaleY)
     });
 }
Exemple #2
0
 public void Add(
     string name,
     float delay,
     Vector2 offset,
     Vector2 origin,
     List <MTexture> textures)
 {
     AnimatedTilesBank.Animation animation = new AnimatedTilesBank.Animation()
     {
         Name   = name,
         Delay  = delay,
         Offset = offset,
         Origin = origin,
         Frames = textures.ToArray()
     };
     animation.ID = this.Animations.Count;
     this.Animations.Add(animation);
     this.AnimationsByName.Add(name, animation);
 }