protected override void LoadContent() { this.animatedTextureInfo = ((IEffectManager)Game.Services.GetService(typeof(IEffectManager)))[Animation.CannonFired]; this.texture = ((ITextureManager)Game.Services.GetService(typeof(ITextureManager)))[Content.CannonAnimation]; this.zIndex = ZIndexManager.getZIndex(ZIndexManager.drawnItemOrders.cannon); base.LoadContent(); }
public AnimationView(Game game, Content content, Color color, SpriteBatch spriteBatch, AnimatedTextureInfo animatedTextureInfo, IGameObject gameObject, float zIndex) : base(game) { this.content = content; this.Color = color; this.SpriteBatch = spriteBatch; this.AnimatedTextureInfo = animatedTextureInfo; this.GameObject = gameObject; this.ZIndex = zIndex; this.FirstDraw = this.AnimatedTextureInfo != null; }
private void addAnimationView(Vector2 position, AnimatedTextureInfo animTextInfo, Color color, float zIndex) { GameObject animationObject = new GameObject(Game, position, animTextInfo.WindowSize.X, animTextInfo.WindowSize.Y); Game.Components.Add(animationObject); var animationView = new AnimationView(Game, animTextInfo.Content, color, spriteBatch, animTextInfo, animationObject, zIndex); animationView.AnimationFinished += HandleAnimationFinished; Game.Components.Add(animationView); currentAnimations.Add(animationView, animationObject); }