예제 #1
0
        internal void Draw(IGraphicsAdapter pSystem)
        {
            //We update and draw at the same time because GameObjects will often manipulate UI elements
            //So if we arrange before those updates can happen it can cause a frame of misplaced items
            var bounds = new Rectangle(0, 0, Game.Form.Width, Game.Form.Height);

            pSystem.ResetTransform();

            foreach (var e in _elements)
            {
                e.Arrange(bounds);

                if (e.Visible == Visibility.Visible)
                {
                    e.DrawInternal(pSystem);
                }
            }
            _measureInvalid = false;
        }