Example #1
0
        public void Draw(Graphics g, Point offset, float scale)
        {
            if ((this.Entity == null) || (g == null))
            {
                return;
            }

            Bitmap icon = IconLibrary.SelectEntityIcon(this.Entity);

            if (icon == null)
            {
                return;
            }

            ImageAttributes attributes = new ImageAttributes();

            attributes.TintByFaction(this.Entity.FactionGroup);
            icon = IconLibrary.AdjustBitmap(icon, this.Size, attributes);
            int dstX = (int)(offset.X + this.Entity.Position.x * scale - icon.Width / 2);
            int dstY = (int)(offset.Y + this.Entity.Position.z * scale - icon.Height / 2);

            g.DrawImage(icon, new Rectangle(dstX, dstY, icon.Width, icon.Height), 0, 0, icon.Width, icon.Height, GraphicsUnit.Pixel, attributes);
        }