Exemplo n.º 1
0
        public LocationAnimation(CardControl control) : base(control)
        {
            Control.Style.RegisterBinding(this);

            m_locationTrack = new Animation.CurveTrack(GameApp.Service<Services.ResourceManager>().Acquire<Curve>("Curves/CardMove"));
            m_locationTrack.Elapsed += w =>
            {
                m_locationTransform = Matrix.Lerp(m_locationSrcTransform, m_locationDstTransform, w);
                m_cardSummoned.EffectInstances.ForEach(fx => fx.IsEmitting = m_playToBattlefield && w != 1.0f);
            };

            NextLocation = m_lastLocation = new LocationParameter { m_zone = null, m_numCards = 0, m_thisIndex = -1, m_focusIndex = -1 };

            m_cardSummoned = new Particle.ParticleSystemInstance(GameApp.Service<Services.ResourceManager>().Acquire<Particle.ParticleSystem>("Particles/CardSummoned"));
            m_cardSummoned.LocalFrameProvider = this;

            m_cardActivated = new Particle.ParticleSystemInstance(GameApp.Service<Services.ResourceManager>().Acquire<Particle.ParticleSystem>("Particles/CardActivated"));
            m_cardActivated.LocalFrameProvider = this;
            m_activateEffectTimer = new Animation.LinearTrack(0.4f);
            m_activateEffectTimer.Elapsed += w =>
            {
                m_cardActivated.EffectInstances.ForEach(fx => fx.IsEmitting = m_lastActivated && w != 1.0f);
            };
            m_activateEffectTimer.Play();
        }
Exemplo n.º 2
0
        public Highlight(CardControl control) : base(control)
        {
            Control.Style.RegisterBinding(this);

            m_quadHighlight = new Graphics.TexturedQuad(GameApp.Service<Resources>().CardHighlight);
            m_quadHighlight.BlendState = new BlendState { ColorSourceBlend = Blend.SourceAlpha, ColorDestinationBlend = Blend.One };

            m_borderBlinkTrack = new Animation.CurveTrack(GameApp.Service<Resources>().CardFloat);
            m_borderBlinkTrack.Loop = true;
            m_borderBlinkTrack.Play();

            m_enlargeTrack = new Animation.CurveTrack(GameApp.Service<Resources>().CardEnlarge);
        }
Exemplo n.º 3
0
        public SelectorHighlight(CardControl control, IControlUI ui)
            : base(control)
        {
            m_ui = ui;

            m_quadHighlight = new Graphics.TexturedQuad(GameApp.Service<Highlight.Resources>().CardHighlight);
            m_quadHighlight.BlendState = new BlendState
            {
                ColorSourceBlend = Blend.SourceAlpha,
                ColorDestinationBlend = Blend.One,
                AlphaBlendFunction = BlendFunction.Max,
                AlphaSourceBlend = Blend.One,
                AlphaDestinationBlend = Blend.One
            };

            m_borderBlinkTrack = new Animation.CurveTrack(GameApp.Service<Highlight.Resources>().CardFloat);
            m_borderBlinkTrack.Loop = true;
            m_borderBlinkTrack.Play();
        }