Exemplo n.º 1
0
        protected override void Initialize()
        {
            this.Renderer = new SpriteBatchRenderer
            {
                GraphicsDeviceService = this.GraphicsDeviceManager,
                Transformation = Matrix.CreateTranslation(GraphicsDeviceManager.GraphicsDevice.Viewport.Width / 2f, GraphicsDeviceManager.GraphicsDevice.Viewport.Height / 2f, 0f)
            }; 

            this.Renderer = new QuadRenderer(10000)
            {
                GraphicsDeviceService = this.GraphicsDeviceManager,
            };


            this.World = Matrix.Identity;
            this.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver2, this.GraphicsDeviceManager.GraphicsDevice.Viewport.AspectRatio, 1f, 5000f);

#if PHONE
            //Hide the status bar on the phone
            this.GraphicsDeviceManager.ToggleFullScreen();
#endif


            base.Initialize();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new instance
        /// </summary>
        public ParticleSystemManager(IManagerServiceProvider sceneInterface)
        {
            _sceneInterface = sceneInterface;

            ManagerProcessOrder = 100;

            Renderer = new QuadRenderer()
                            {
                                GraphicsDeviceService = GraphicsDeviceManager,
                            };

            Renderer.LoadContent(Application.ContentManager);

            _activeParticles = SystemConsole.GetStatistic("ParticleSystem_ActiveParticles", SystemStatisticCategory.Rendering);
        }
        public override void Initialise()
        {
            if (m_Graphics != null)
            {
                m_Renderer = new SpriteBatchRenderer
                {
                    GraphicsDeviceService = m_Graphics,
                    Transformation = Matrix.CreateTranslation((m_Graphics.GraphicsDevice.Viewport.Width * 0.5f), (m_Graphics.GraphicsDevice.Viewport.Height * 0.5f), 0f)
                };

                m_Renderer = new ProjectMercury.Renderers.QuadRenderer(10000)
                {
                    GraphicsDeviceService = m_Graphics,
                };
            }

            // Test ( add particle )
            //AddParticleEffect("magictrail");
        }
Exemplo n.º 4
0
        /// <summary>
        /// Draws the specified effect.
        /// </summary>
        /// <param name="effect">The effect.</param>
        /// <param name="renderer">The renderer.</param>
        public void Draw(ParticleEffect effect, AbstractRenderer renderer)
        {
            this.uxActiveParticlesLabel.Text = String.Format("{0} Active Particles", effect.ActiveParticlesCount);

            this.uxEffectPreview.ParticleEffect = effect;
            this.uxEffectPreview.Renderer = renderer;

            this.uxEffectPreview.Invalidate();
        }
 public MercuryParticleEffect(ContentManager content, String particleName, AbstractRenderer renderer) : base(content, particleName)
 {
     m_Renderer = renderer;
     m_BaseDirectory += "Mercury/";
 }