protected override void Initialise() { Camera2D camera = new Camera2D(); //create the draw target. drawToScreen = new DrawTargetScreen(camera); drawToScreen.ClearBuffer.ClearColour = Color.Black; // uncomment this to force theparticle system to run on the CPU // Note: This property is not available on the xbox. //ParticleSystem.ForceUseCpuParticleSystem = true; // Use ParticleSystem.SystemSupportsGpuParticles to determine if the particle // system will be run on the GPU // // NOTE: When running on the GPU, the particle system will be processed in 16bit floating point // The CPU particle system is not supported on the Xbox. //NEW CODE //create the particle system this.particles = new ParticleSystem(this.UpdateManager); //Like ModelInstance, the ParticleSystem content must be assigned before it can be drawn //create the particle drawer, //In this case, use a VelocityBillboardParticles2DElement. //This is a special particle drawer that will 'stretch' particles in the direction they are //travelling - giving them a streaky look. // particleDrawer = new Xen.Ex.Graphics.Display.VelocityBillboardParticles2DElement(this.particles, true); //align the drawer to the bottom centre of the screen particleDrawer.VerticalAlignment = VerticalAlignment.Bottom; particleDrawer.HorizontalAlignment = HorizontalAlignment.Centre; //add it to ths screen drawToScreen.Add(particleDrawer); }
protected override void Initialise() { Camera2D camera = new Camera2D(); //create the draw target. drawToScreen = new DrawTargetScreen(this, camera); drawToScreen.ClearBuffer.ClearColour = Color.Black; // uncomment this to force theparticle system to run on the CPU // Note: This property is not available on the xbox. //ParticleSystem.ForceUseCpuParticleSystem = true; // Use ParticleSystem.SystemSupportsGpuParticles to determine if the particle // system will be run on the GPU // // NOTE: When running on the GPU, the particle system will be processed in 16bit floating point // The CPU particle system is not supported on the Xbox. //NEW CODE //create the particle system this.particles = new ParticleSystem(this.UpdateManager); //Like ModelInstance, the ParticleSystem content must be assigned before it can be drawn //create the particle drawer, //In this case, use a VelocityBillboardParticles2DElement. //This is a special particle drawer that will 'stretch' particles in the direction they are //travelling - giving them a streaky look. // particleDrawer = new Xen.Ex.Graphics.Display.VelocityBillboardParticles2DElement(this.particles, true); //align the drawer to the bottom centre of the screen particleDrawer.VerticalAlignment = VerticalAlignment.Bottom; particleDrawer.HorizontalAlignment = HorizontalAlignment.Centre; //add it to ths screen drawToScreen.Add(particleDrawer); }