Exemple #1
0
 public Timer(Timer timer)
     : base(timer.Game)
 {
     this.Enabled = timer.Enabled;
     this.Interval = timer.Interval;
     this.timeCounter = timer.timeCounter;
 }
Exemple #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            this.Services.AddService(typeof(SpriteBatch), spriteBatch);

            // TODO: use this.Content to load your game content here
            timer = new Counter.Timer(this, 2000);
            timer.OnMeet += new Counter.EventOnCounterMeet(this.TimerTick);
            timer.Start();

            tahoma = Content.Load<SpriteFont>("Tahoma");
            this.Services.AddService(typeof(SpriteFont), tahoma);
        }