public void RegisterAnimation(string resourceID, string[] spriteIds, DrawEffects2D suggestedDrawEffect, float fps) { if (animations.ContainsKey(resourceID)) { throw new ArgumentException("The provided key (" + resourceID + ") is in use already.", "resourceID"); } var animFrames = new Sprite[spriteIds.Length]; for (int i = 0; i < spriteIds.Length; i++) { animFrames[i] = GetSprite(spriteIds[i]); } animations.Add(resourceID, new Animation(animFrames, suggestedDrawEffect, fps)); }
public void RegisterAnimation(string resourceID, string[] spriteIds, DrawEffects2D suggestedDrawEffect, float fps) { if (animations.ContainsKey(resourceID)) { throw new ArgumentException("The provided key (" + resourceID + ") is in use already.", "resourceID"); } var animFrames = new Sprite[spriteIds.Length]; for (int i = 0; i < spriteIds.Length; i++) { animFrames[i] = GetSprite(spriteIds[i]); } animations.Add(resourceID, new Animation(animFrames, suggestedDrawEffect, fps)); ServiceLocator.GetLogService().LogMessage("TextureService", "Animation " + resourceID + " registered.", LogLevel.Verbose, LogType.Log); }