Render() public méthode

Renders the element using the specified renderer.
public Render ( UserInterfaceRenderer renderer, Element element, int x, int y, int width, int height ) : void
renderer UserInterfaceRenderer The renderer.
element Element The element.
x int The X coordinate (in pixels) of the upper left corner of the region the element should be rendered to.
y int The Y coordinate (in pixels) of the upper left corner of the region the element should be rendered to.
width int The width (in pixels) of the region the element should be rendered to.
height int The height (in pixels) of the region the element should be rendered to.
Résultat void
        /// <summary>
        /// Renders the specified user interface.
        /// </summary>
        /// <param name="userInterface">The user interface to render.</param>
        public void Render(UserInterface userInterface)
        {
            if (userInterface == null)
                throw new ArgumentNullException("userInterface");

            int y = 0;
            foreach (Element element in userInterface.Container) {
                IElementVisual visual = new DefaultVisual();
                Vector2 size = visual.Measure(this, element);
                visual.Render(this, element, 0, y, (int)size.X, (int)size.Y);
                y += (int)size.Y;
            }

            Flush();
        }
Exemple #2
0
        /// <summary>
        /// Renders the specified user interface.
        /// </summary>
        /// <param name="userInterface">The user interface to render.</param>
        public void Render(UserInterface userInterface)
        {
            if (userInterface == null)
            {
                throw new ArgumentNullException("userInterface");
            }

            int y = 0;

            foreach (Element element in userInterface.Container)
            {
                IElementVisual visual = new DefaultVisual();
                Vector2        size   = visual.Measure(this, element);
                visual.Render(this, element, 0, y, (int)size.X, (int)size.Y);
                y += (int)size.Y;
            }

            Flush();
        }