我不确定使用图形的最佳方式是什么 - 我应该将我的类附加到主窗体的Paint事件,然后进行绘制,还是从重写的OnPaint void中调用它更好?我的意思是,像这样做可以吗:
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e) //what is this good for? My app works without it as well
Graphics g=e.Graphics;
DrawEnemies(g);
UpdateHUD(g);
DrawSelectedUnit(g);
}