Exemplo n.º 1
0
 void PaintBackground(DateTime now)
 {
     if (currentBackground != null)
     {
         Painter.Blit(currentBackground);
     }
 }
Exemplo n.º 2
0
		protected void BackgroundPainter (DateTime dt)
		{
			int background_x = (Painter.Width - background.Width) / 2;
			int background_y = (Painter.Height - background.Height) / 2;

			Painter.Blit (background, new Point (background_x, background_y));
		}
Exemplo n.º 3
0
        void PaintSprite(DateTime now)
        {
            if (sprite_surface == null)
            {
                return;
            }

            /* make sure the sprite is on screen before doing the rectangle intersection/blit stuff */
            if (sprite_surface != null)
            {
                if ((x > SpriteManager.X - sprite_surface.Width / 2) && (x - sprite_surface.Width / 2 <= SpriteManager.X + Painter.SCREEN_RES_X) &&
                    (y > SpriteManager.Y - sprite_surface.Height / 2) && (y - sprite_surface.Height / 2 <= SpriteManager.Y + 375))
                {
                    Painter.Blit(sprite_surface,
                                 new Point(x - SpriteManager.X - sprite_surface.Width / 2,
                                           y - SpriteManager.Y - sprite_surface.Height / 2));

                    if (show_sprite_borders)
                    {
                        Painter.DrawBox(new Rectangle(new Point(x - SpriteManager.X - sprite_surface.Width / 2,
                                                                y - SpriteManager.Y - sprite_surface.Height / 2),
                                                      new Size(sprite_surface.Width - 1,
                                                               sprite_surface.Height - 1)),
                                        Color.Green);
                    }
                }
            }
        }
Exemplo n.º 4
0
 void VideoPainter(DateTime dt)
 {
     if (surf != null)
     {
         Painter.Blit(surf,
                      new Point((Painter.Width - surf.Width) / 2,
                                (Painter.Height - surf.Height) / 2));
     }
 }
Exemplo n.º 5
0
        public void Paint(DateTime now)
        {
            if (!visible)
            {
                return;
            }

            Surface s = Surface;

            if (s == null)
            {
                return;
            }

            Painter.Blit(s, new Point(X1, Y1));
        }
Exemplo n.º 6
0
        void Paint(DateTime now)
        {
            int draw_x = (int)(x - hot_x);
            int draw_y = (int)(y - hot_y);

            if (current_frame == grp.FrameCount)
            {
                current_frame = 0;
            }

            if (surfaces[current_frame] == null)
            {
                surfaces[current_frame] = GuiUtil.CreateSurfaceFromBitmap(grp.GetFrame(current_frame),
                                                                          grp.Width, grp.Height,
                                                                          palette,
                                                                          true);
            }

            Painter.Blit(surfaces[current_frame], new Point(draw_x, draw_y));
        }
Exemplo n.º 7
0
 public void Paint(DateTime dt)
 {
     Painter.Blit(mapSurface, Painter.Dirty, Painter.Dirty);
 }
Exemplo n.º 8
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.º 9
0
 void DimScreenPainter(DateTime dt)
 {
     Painter.Blit(dimScreenSurface, Painter.Dirty, Painter.Dirty);
 }
Exemplo n.º 10
0
 void PaintDropdown(DateTime dt)
 {
     Painter.Blit(dropdownSurface, new Point(X1, Y1 + Height));
 }
Exemplo n.º 11
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);
                }
            }
        }