Example #1
0
        // Vẽ các object trong một khung visibleRect, sử dụng đổi hệ trục toạ độ.
        public void draw(Graphics Graphics, Rectangle visilbleRect, int worldheight)
        {
            List <GameObject> listobject = new List <GameObject>();

            this.QuadTree.getListObject(ref listobject, visilbleRect);
            foreach (GameObject GObject in listobject)
            {
                var activebound = GObject.GetActiveBoundTransform(worldheight);
                var initbound   = GObject.GetInitBoundTransform(worldheight);
                if (GObject.Image == null)
                {
                    Graphics.FillRectangle(brush_initBound, initbound);
                }
                else
                {
                    Graphics.DrawImage(GObject.Image, initbound);
                }
                Graphics.FillRectangle(brush, activebound);
                Graphics.DrawString(
                    GObject.Name,
                    SystemFonts.IconTitleFont,
                    brush_font,
                    activebound.X + 3,
                    activebound.Y + 3);
            }
        }
Example #2
0
 // Vẽ tất cả object, sử dụng đổi hệ trục toạ độ
 public void draw(Graphics graphics, int worldheight)
 {
     foreach (GameObject GObject in ListItem)
     {
         var activebound = GObject.GetActiveBoundTransform(worldheight);
         var initbound   = GObject.GetInitBoundTransform(worldheight);
         if (GObject.Image == null)
         {
             graphics.FillRectangle(brush_initBound, initbound);
         }
         else
         {
             graphics.DrawImage(GObject.Image, initbound);
         }
         graphics.FillRectangle(brush, activebound);
         graphics.DrawString(
             GObject.Name,
             SystemFonts.IconTitleFont,
             brush_font,
             activebound.X + 3,
             activebound.Y + 3);
     }
 }