// Timer to simulate the XNA game loop (SoundEffect classes are from the XNA Framework)
// Nigel notes, added an Event Handler so I can perform activities during certain time intervals, running
// anywhere from 10MS to 10 minutes and anywhere in between, including utilizing random to perform
// random items. In this case i WANT volume to fade out over a 20 minute time period
DispatcherTimer XnaDispatchTimer = new DispatcherTimer();
XnaDispatchTimer.Interval = TimeSpan.FromMilliseconds(10);
// Call FrameworkDispatcher.Update to update the XNA Framework internals.
XnaDispatchTimer.Tick += delegate { try { FrameworkDispatcher.Update(); } catch { } };
XnaDispatchTimer.Tick += new EventHandler(frameworkDispatcherTimer_Tick);
// Start the DispatchTimer running.
XnaDispatchTimer.Start();
// in code do this
// make a method:
public void frameworkDispatcherTimer_Tick(object sender, EventArgs e)
{
textBlock1.Text = "i RAN" + nigelcounter;
nigelcounter += 1;
//Console.WriteLine( nigelcounter);
}
No comments:
Post a Comment