![]() |
| | #1 |
| essence of digital Join Date: Sep 2003
Posts: 577
| OnPaint and dissappearing graphics Code:
public static void RePaintPlayer(Graphics[] g)
{
for (int x = 1; x <= 4; x++)
{
if (GS.Players[x].CurrentPosition != 0)
{
g[GS.Players[x].CurrentPosition].FillRectangle(new SolidBrush(Color.Blue), 0, 0, 50, 50);
g[GS.Players[x].CurrentPosition].DrawString("Player\n" + x, ArielFont, WhiteColor, new PointF(5, 10));
}
}
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
for (int index = 1; index <= 64; index++)
{
GameUI.CorrectImage(index);
}
GameUI.RePaintPlayer(GameUI.g);
}
__________________ "Hence to fight and conquer in all your battles is not supreme excellence; supreme excellence consists in breaking the enemy's resistance without fighting." Art of War Sun Tzu |
| xddxogm3 is offline | |
| | #2 |
| the hat of redundancy hat Join Date: Aug 2001 Location: Hannover, Germany
Posts: 2,769
| If you have not done so already, consider setting the control styles to something more suited to painting yourself: http://msdn.microsoft.com/en-us/libr...le(VS.71).aspx If you do this, you may have to draw the background yourself. Also, I'd recommend to use a single control for painting. Do the calculations yourself and paint all of it in one control.
__________________ hth -nv She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate." When in doubt, read the FAQ. Then ask a smart question. |
| nvoigt is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|