Exemple #1
0
 public void Render(SKCanvas canvas, int width, int height)
 {
     foreach (Train train in _gameBoard.GetTrains())
     {
         canvas.Save();
         _trainRenderer.Render(canvas, train);
     }
 }
        public void Render(SKCanvas canvas, int width, int height)
        {
            long now = _stopwatch.ElapsedMilliseconds;
            long timeSinceLastUpdate = now - _lastDrawTime;

            _lastDrawTime = now;

            int y = 1;

            canvas.DrawText((1000 / timeSinceLastUpdate) + " FPS", 0, (y++) * 25, _paint);

            canvas.DrawText(_gameBoard.GetTracks().Count() + " Tracks", 0, (y++) * 25, _paint);

            canvas.DrawText(_gameBoard.GetTrains().Count() + " Trains", 0, (y++) * 25, _paint);
        }