MegaMan.LevelEditor.ScreenDocument.DrawEntities C# (CSharp) Method

DrawEntities() public method

public DrawEntities ( Graphics graphics ) : void
graphics System.Drawing.Graphics
return void
        public void DrawEntities(Graphics graphics)
        {
            for (var i = 0; i < screen.Layers[0].Entities.Count; i++)
            {
                var info = screen.Layers[0].Entities[i];

                var sprite = Stage.Project.EntityByName(info.entity).MainSprite;

                if (sprite != null)
                {
                    //sprite.Draw(graphics, info.screenX, info.screenY);

                    if (selectedEntityIndex == i)
                    {
                        graphics.DrawRectangle(Pens.LimeGreen, info.screenX - sprite.HotSpot.X, info.screenY - sprite.HotSpot.Y, sprite.Width, sprite.Height);
                    }
                }
                else
                {
                    graphics.DrawImage(Properties.Resources.nosprite, info.screenX - 8, info.screenY - 8);

                    if (selectedEntityIndex == i)
                    {
                        graphics.DrawRectangle(Pens.LimeGreen, info.screenX - 8, info.screenY - 8, 16, 16);
                    }
                }
            }
        }