public StandardCharacterAnimation(AnimatedSpriteCollection bodyAnimation, AnimatedSpriteCollection eyeAnimation, AnimatedSpriteCollection hairAnimation, AnimatedSpriteCollection shirtAnimation, AnimatedSpriteCollection pantsAnimation, AnimatedSpriteCollection shoesAnimation, List <AnimatedSpriteCollection> accessoriesWithAnimations) : base() { this.body = bodyAnimation; this.hair = hairAnimation; this.eyes = eyeAnimation; this.shirt = shirtAnimation; this.pants = pantsAnimation; this.shoes = shoesAnimation; this.accessories = accessoriesWithAnimations; }
/// <summary> /// Generate a Standard Character Animation from some asset sheets. /// (collection of textures to animations) /// </summary> /// <param name="body">The textures for the npc's body.</param> /// <param name="eyes">The textures for the npc's eyes.</param> /// <param name="hair">The textures for the npc's hair.</param> /// <param name="shirt">The textures for the npc's shirt.</param> /// <param name="pants">The textures for the npc's pants.</param> /// <param name="shoes">The textures for the npc's shoes.</param> /// <param name="accessoryType">The textures for the npc's accessories.</param> /// <param name="DrawColors">The colors for the npc's different assets.</param> /// <returns></returns> public virtual StandardCharacterAnimation generateCharacterAnimation(AssetSheet body, AssetSheet eyes, AssetSheet hair, AssetSheet shirt, AssetSheet pants, AssetSheet shoes, List <AssetSheet> accessories, AnimationType animationType, StandardColorCollection DrawColors = null) { var bodySprite = getSpriteCollectionFromSheet(body, animationType); var eyesSprite = getSpriteCollectionFromSheet(eyes, animationType); var hairSprite = getSpriteCollectionFromSheet(hair, animationType); var shirtSprite = getSpriteCollectionFromSheet(shirt, animationType); var pantsSprite = getSpriteCollectionFromSheet(pants, animationType); var shoesSprite = getSpriteCollectionFromSheet(shoes, animationType); List <AnimatedSpriteCollection> accessoryCollection = new List <AnimatedSpriteCollection>(); foreach (var v in accessories) { AnimatedSpriteCollection acc = getSpriteCollectionFromSheet(v, AnimationType.standing); accessoryCollection.Add(acc); } if (DrawColors == null) { DrawColors = new StandardColorCollection(); } StandardCharacterAnimation standingAnimation = new StandardCharacterAnimation(bodySprite, eyesSprite, hairSprite, shirtSprite, pantsSprite, shoesSprite, accessoryCollection, DrawColors); return(standingAnimation); }
/// <summary>Generate a Standard Character Animation from some asset sheets. (collection of textures to animations)</summary> /// <param name="body">The textures for the NPC's body.</param> /// <param name="eyes">The textures for the NPC's eyes.</param> /// <param name="hair">The textures for the NPC's hair.</param> /// <param name="shirt">The textures for the NPC's shirt.</param> /// <param name="pants">The textures for the NPC's pants.</param> /// <param name="shoes">The textures for the NPC's shoes.</param> /// <param name="accessories">The textures for the NPC's accessories.</param> /// <param name="animationType">The animation type to generate.</param> /// <param name="drawColors">The colors for the NPC's different assets.</param> public virtual StandardCharacterAnimation generateCharacterAnimation(AssetSheet body, AssetSheet eyes, AssetSheet hair, AssetSheet shirt, AssetSheet pants, AssetSheet shoes, List <AssetSheet> accessories, AnimationType animationType, StandardColorCollection drawColors = null) { AnimatedSpriteCollection bodySprite = this.getSpriteCollectionFromSheet(body, animationType); AnimatedSpriteCollection eyesSprite = this.getSpriteCollectionFromSheet(eyes, animationType); AnimatedSpriteCollection hairSprite = this.getSpriteCollectionFromSheet(hair, animationType); AnimatedSpriteCollection shirtSprite = this.getSpriteCollectionFromSheet(shirt, animationType); AnimatedSpriteCollection pantsSprite = this.getSpriteCollectionFromSheet(pants, animationType); AnimatedSpriteCollection shoesSprite = this.getSpriteCollectionFromSheet(shoes, animationType); List <AnimatedSpriteCollection> accessoryCollection = new List <AnimatedSpriteCollection>(); foreach (var v in accessories) { AnimatedSpriteCollection acc = this.getSpriteCollectionFromSheet(v, AnimationType.standing); accessoryCollection.Add(acc); } if (drawColors == null) { drawColors = new StandardColorCollection(); } return(new StandardCharacterAnimation(bodySprite, eyesSprite, hairSprite, shirtSprite, pantsSprite, shoesSprite, accessoryCollection, drawColors)); }