Exemplo n.º 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();
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void Paint(DateTime dt)
 {
     Painter.Blit(mapSurface, Painter.Dirty, Painter.Dirty);
 }
Exemplo n.º 3
0
 public override void RemoveFromPainter()
 {
     base.RemoveFromPainter();
     Painter.Remove(Layer.Background, PaintBackground);
     Painter.Remove(Layer.UI, PaintMarkup);
 }
Exemplo n.º 4
0
 public override void AddToPainter()
 {
     base.AddToPainter();
     Painter.Add(Layer.Background, PaintBackground);
     Painter.Add(Layer.UI, PaintMarkup);
 }
Exemplo n.º 5
0
            public void Paint()
            {
                int y;

                switch (location)
                {
                case PageLocation.Top:
                    y = Y_OFFSET;
                    foreach (Surface s in lineSurfaces)
                    {
                        if (s != null)
                        {
                            Painter.Blit(s, new Point((Painter.Width - s.Width) / 2, y));
                            y += s.Height;
                        }
                        else
                        {
                            y += fnt.LineSize;
                        }
                    }
                    break;

                case PageLocation.Bottom:
                    y = Painter.Height - Y_OFFSET - fnt.LineSize * lines.Count;
                    foreach (Surface s in lineSurfaces)
                    {
                        if (s != null)
                        {
                            Painter.Blit(s, new Point((Painter.Width - s.Width) / 2, y));
                            y += s.Height;
                        }
                        else
                        {
                            y += fnt.LineSize;
                        }
                    }
                    break;

                case PageLocation.Left:
                    y = (Painter.Height - fnt.LineSize * lines.Count) / 2;
                    foreach (Surface s in lineSurfaces)
                    {
                        if (s != null)
                        {
                            Painter.Blit(s, new Point(X_OFFSET, y));
                            y += s.Height;
                        }
                        else
                        {
                            y += fnt.LineSize;
                        }
                    }
                    break;

                case PageLocation.LowerLeft:
                    y = Painter.Height - Y_OFFSET - fnt.LineSize * lines.Count;
                    foreach (Surface s in lineSurfaces)
                    {
                        if (s != null)
                        {
                            Painter.Blit(s, new Point(X_OFFSET, y));
                            y += s.Height;
                        }
                        else
                        {
                            y += fnt.LineSize;
                        }
                    }
                    break;

                case PageLocation.Right:
                    y = (Painter.Height - fnt.LineSize * lines.Count) / 2;
                    foreach (Surface s in lineSurfaces)
                    {
                        if (s != null)
                        {
                            Painter.Blit(s, new Point(Painter.Width - s.Width - X_OFFSET, y));
                            y += s.Height;
                        }
                        else
                        {
                            y += fnt.LineSize;
                        }
                    }
                    break;

                case PageLocation.Center:
                    y = (Painter.Height - fnt.LineSize * lines.Count) / 2;
                    foreach (Surface s in lineSurfaces)
                    {
                        if (s != null)
                        {
                            Painter.Blit(s, new Point((Painter.Width - s.Width) / 2, y));
                            y += s.Height;
                        }
                        else
                        {
                            y += fnt.LineSize;
                        }
                    }
                    break;
                }
            }
Exemplo n.º 6
0
 void DimScreenPainter(DateTime dt)
 {
     Painter.Blit(dimScreenSurface, Painter.Dirty, Painter.Dirty);
 }
Exemplo n.º 7
0
 void PaintDropdown(DateTime dt)
 {
     Painter.Blit(dropdownSurface, new Point(X1, Y1 + Height));
 }
Exemplo n.º 8
0
 public void RemoveFromPainter()
 {
     Painter.Remove(Layer.Cursor, Paint);
     Events.Tick -= CursorTick;
 }
Exemplo n.º 9
0
 public void AddToPainter()
 {
     Painter.Add(Layer.Cursor, Paint);
     Events.Tick += CursorTick;
 }
Exemplo n.º 10
0
 public void Invalidate()
 {
     Painter.Invalidate(new Rectangle(new Point(x - SpriteManager.X - sprite_surface.Width / 2,
                                                y - SpriteManager.Y - sprite_surface.Height / 2),
                                      sprite_surface.Size));
 }
Exemplo n.º 11
0
 public void RemoveFromPainter()
 {
     Painter.Remove(Layer.Unit, PaintSprite);
 }
Exemplo n.º 12
0
 public void AddToPainter()
 {
     Painter.Add(Layer.Unit, PaintSprite);
 }
Exemplo n.º 13
0
        void PaintStarfield(DateTime dt)
        {
            float scroll_factor = 1.0f;

            float[] factors = new float[starfield_layers.Length];

            for (int i = 0; i < starfield_layers.Length; i++)
            {
                factors[i]     = scroll_factor;
                scroll_factor *= 0.75f;
            }

            Rectangle dest;
            Rectangle source;

            for (int i = starfield_layers.Length - 1; i >= 0; i--)
            {
                int scroll_x = (int)(topleft_x * factors[i]);
                int scroll_y = (int)(topleft_y * factors[i]);

                if (scroll_x > Painter.SCREEN_RES_X)
                {
                    scroll_x %= Painter.SCREEN_RES_X;
                }
                if (scroll_y > 375)
                {
                    scroll_y %= 375;
                }


                dest = new Rectangle(new Point(0, 0),
                                     new Size(Painter.SCREEN_RES_X - scroll_x,
                                              375 - scroll_y));
                source    = dest;
                source.X += scroll_x;
                source.Y += scroll_y;

                Painter.Blit(starfield_layers[i],
                             dest, source);

                if (scroll_x != 0)
                {
                    dest = new Rectangle(new Point(Painter.SCREEN_RES_X - scroll_x, 0),
                                         new Size(scroll_x, 375 - scroll_y));
                    source    = dest;
                    source.X -= Painter.SCREEN_RES_X - scroll_x;
                    source.Y += scroll_y;

                    Painter.Blit(starfield_layers[i],
                                 dest, source);
                }

                if (scroll_y != 0)
                {
                    dest = new Rectangle(new Point(0, 375 - scroll_y),
                                         new Size(Painter.SCREEN_RES_X - scroll_x, scroll_y));
                    source    = dest;
                    source.X += scroll_x;
                    source.Y -= 375 - scroll_y;

                    Painter.Blit(starfield_layers[i],
                                 dest, source);
                }

                if (scroll_x != 0 || scroll_y != 0)
                {
                    dest = new Rectangle(new Point(Painter.SCREEN_RES_X - scroll_x, 375 - scroll_y),
                                         new Size(scroll_x, scroll_y));
                    source    = dest;
                    source.X -= Painter.SCREEN_RES_X - scroll_x;
                    source.Y -= 375 - scroll_y;

                    Painter.Blit(starfield_layers[i],
                                 dest, source);
                }
            }
        }
Exemplo n.º 14
0
        public override void AddToPainter()
        {
            base.AddToPainter();

            Painter.Add(Layer.Background, VideoPainter);
        }