protected override void UpdateComponent()
 {
     if (CreatedEquiptment == null)
     {
         CreatedEquiptment = new Equiptment();
     }
 }
Exemple #2
0
        public void LoadImage(Bitmap imageHelmet, Bitmap imageTorso, Bitmap imageLegs, Equiptment weapon)
        {
            int bx = -1, by = -1;

            if (weapon != null)
            {
                bx = ConnectionPoint.X - weapon.ConnectionPointX;
                by = weapon.ConnectionPointY - ConnectionPoint.Y;
                int calculatedX = bx + 48;
                int calculatedY = by + 48;
                ArmoredImage = new Bitmap(calculatedX, calculatedY);
            }
            else
            {
                ArmoredImage = new Bitmap(48, 48);
            }

            using (Graphics g = Graphics.FromImage(ArmoredImage))
            {
                g.DrawImage(WorldImg, 0, by, 48, 48);

                if (imageHelmet != null)
                {
                    g.DrawImage(imageHelmet, 0, 34);
                }

                if (imageTorso != null)
                {
                    g.DrawImage(imageTorso, 0, 18);
                }

                if (imageLegs != null)
                {
                    g.DrawImage(imageLegs, 0, 0);
                }

                if (weapon != null)
                {
                    g.DrawImage(weapon.Icon, bx, 0, 48, 48);
                }
            }
        }
 public override void ClearVariable()
 {
     CreatedEquiptment = new Equiptment();
 }