private void InitObjects() { RandomFeed = new Random(); Batch = new SpriteBatch(XNADevices.graphicsdevice); PEngine = new ParticleEngine(new Rectangle(0, 0, panel1.Width, panel1.Height)); }
void Init() { //ATL_Temps.LoadAnimation(animation); ATL_Temps.Enabled = false; CB_ParticleShape.DataSource = Enum.GetValues(typeof(ParticleShape)); CB_Behavior.DataSource = Enum.GetValues(typeof(ParticleBehaviour)); NUM_VectorX.Minimum = -1 * (PN_Pixel.Width / 2); NUM_VectorX.Maximum = PN_Pixel.Width / 2; NUM_VectorY.Minimum = -1 * (PN_Pixel.Height / 2); NUM_VectorY.Maximum = PN_Pixel.Height / 2; LB_FadeOutStart.Enabled = CHK_FadeOut.Checked; NUM_FadeOutStart.Enabled = CHK_FadeOut.Checked; LB_FadeInFrameCount.Enabled = CHK_FadeIn.Checked; NUM_FadeInFrameCount.Enabled = CHK_FadeIn.Checked; XNADevices.graphicsdevice = new GraphicsDevice( GraphicsAdapter.DefaultAdapter, GraphicsProfile.Reach, new PresentationParameters() { BackBufferHeight = PN_Pixel.Height, BackBufferWidth = PN_Pixel.Width, IsFullScreen = false, DeviceWindowHandle = PN_Pixel.Handle } ); Batch = new SpriteBatch(XNADevices.graphicsdevice); Engine = new ParticleEngine(new Microsoft.Xna.Framework.Rectangle(0, 0, PN_Pixel.Width, PN_Pixel.Height)); AnimationBuffer = new Bitmap(PN_Pixel.Width, PN_Pixel.Height); }