SCSharp.UI.UIElement.Paint C# (CSharp) Method

Paint() public method

public Paint ( System.DateTime now ) : void
now System.DateTime
return void
        public void Paint(DateTime now)
        {
            if (!visible)
                return;

            if (Surface == null)
                return;

            Painter.Blit (Surface, new Point (X1, Y1));
        }

Usage Example

Example #1
0
        public void Paint(DateTime now)
        {
            for (int i = 0; i < elements.Count; i++)
            {
                UIElement e = elements[i];

                if (e == null)
                {
                    continue;
                }

                e.Paint(now);

                if (showBorders)
                {
                    Painter.DrawBox(new Rectangle(new Point(e.X1, e.Y1), new Size(e.Width - 1, e.Height - 1)),
                                    e.Visible ? Color.Green : Color.Yellow);
                    if (e.Text == "")
                    {
                        e.Text = i.ToString();
                    }
                }
            }
        }