Exemple #1
0
        public override void Draw(DrawArgs args)
        {
            //foreach (var gameObject in GameObjects)
            //{
            //    var drawable = gameObject as DrawableGameObject;
            //    if (drawable != null)
            //        args.DrawInGameZone(drawable);
            //}

            var groupsByCoords = GameObjects.OrderBy(obj => obj.Z).GroupBy(obj => obj.X, obj => obj.Y);
        }
Exemple #2
0
        private void StartDraw()
        {
            _drawLastTime = DateTime.Now;
            while (!_exit)
            {
                UpdateCamera();

                _drawElapsedTime = (DateTime.Now - _drawLastTime).TotalMilliseconds;
                _drawLastTime = DateTime.Now;
                _drawTime += _drawElapsedTime;
                _toDraw += _drawElapsedTime;
                if (_toDraw >= _frame)
                {
                    var args = new DrawArgs(_drawer)
                    {
                        GlobalTime = _drawTime,
                        ElapsedTime = _toDraw,
                        CameraPositionAtMap = _camera.Position
                    };
                    Draw(args);
                    _toDraw = 0;
                }
            }
        }
Exemple #3
0
        private void Draw(DrawArgs args)
        {
            _currentMap.Draw(args);
            _ui.Draw(args);

            _drawer.Flush();
        }
        public virtual void Draw(DrawArgs args)
        {
            if (!IsVisible)
                return;

            if (IsAnimuted)
            {
                throw new NotImplementedException();
            }
            args.DrawAtAbsolutePoint(VisualPoint, Tile);
        }
Exemple #5
0
        public override void Draw(DrawArgs args)
        {
            int xLength = _map.GetLength(0);
            int yLength = _map.GetLength(1);

            for (int x = 0; x < xLength; x++)
                for (int y = 0; y < yLength; y++)
                {
                    var drawable =
                        (DrawableGameObject) this[x, y].LastOrDefault(obj => (obj as DrawableGameObject) != null);
                    if (drawable != null)
                        args.DrawInGameZone(drawable);
                }
        }