コード例 #1
0
ファイル: CannonView.cs プロジェクト: rpwjanzen/2HourGame
        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();
        }
コード例 #2
0
ファイル: AnimationView.cs プロジェクト: rpwjanzen/2HourGame
        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;
        }
コード例 #3
0
ファイル: EffectManager.cs プロジェクト: rpwjanzen/2HourGame
        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);
        }