public void RefreshSprites(List <Animal> animals) { AnimalLayer.Clear(); foreach (var animal in animals) { if (animal == null) { continue; } var sprite = CreateAnimalSprite(animal, animal.X, animal.Y); AnimalLayer.AddChild(sprite); animal.SetSprite(sprite); animal.Sprite.SetAlpha(0.0F); var fullScale = animal.Sprite.Scale; animal.Sprite.Scale *= 0.75F; animal.Sprite.AddActivity(new ActivitySequence(new Activity[] { new WaitActivity(TimeSpan.FromSeconds(0.1F)), new ActivityGroup(new Activity[] { new FadeActivity(FadeActivity.Fade.In, TimeSpan.FromSeconds(0.2F), EaseMode.In), new ScaleActivity(animal.Sprite.Scale, fullScale, TimeSpan.FromSeconds(0.2F), EaseMode.In) }) })); } }
public void DropAnimal(Animal animal, int y) { var sprite = CreateAnimalSprite(animal, animal.X, y); AnimalLayer.AddChild(sprite); animal.SetSprite(sprite); animal.Sprite.SetAlpha(0.0F); }