Esempio n. 1
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);
                    }
                }
            }
        }
Esempio n. 2
0
        void PaintMinimap(DateTime dt)
        {
            Rectangle rect = new Rectangle(new Point((int)((float)topleft_x / (float)mapRenderer.MapWidth * MINIMAP_WIDTH + MINIMAP_X),
                                                     (int)((float)topleft_y / (float)mapRenderer.MapHeight * MINIMAP_HEIGHT + MINIMAP_Y)),
                                           new Size((int)((float)Painter.SCREEN_RES_X / (float)mapRenderer.MapWidth * MINIMAP_WIDTH),
                                                    (int)((float)Painter.SCREEN_RES_Y / (float)mapRenderer.MapHeight * MINIMAP_HEIGHT)));

            Painter.DrawBox(rect, Color.Green);
        }
Esempio n. 3
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();
                    }
                }
            }
        }