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(); }
internal void GameCreated() { float vw = GameApp.Instance.GraphicsDevice.Viewport.Width; float vh = GameApp.Instance.GraphicsDevice.Viewport.Height; m_toScreenSpace = Matrix.Identity; m_toScreenSpace.M11 = 2.0f / vw; m_toScreenSpace.M22 = -2.0f / vh; m_toScreenSpace.M41 = -1.0f; m_toScreenSpace.M42 = 1.0f; var resourceMgr = GameApp.Service<Services.ResourceManager>(); m_backgroundImage = new TexturedQuad(resourceMgr.Acquire<VirtualTexture>("Textures/Scene2")); m_beamMeUp = new Particle.ParticleSystemInstance(resourceMgr.Acquire<Particle.ParticleSystem>("Particles/BeamMeUp")); m_loaded = true; m_currentEnvImageIndex = 0; m_envImages[m_currentEnvImageIndex] = m_backgroundImage; }