Tic Tac Toe 1afase
Tic Tac Toe 1afase
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
namespace CSDGame
{
public class GFX
{
private static Graphics gObject;
public GFX(Graphics g)
{
gObject = g;
setUpCanvas();
}
public static void setUpCanvas()
{
Brush bg = new SolidBrush(Color.WhiteSmoke);
Pen lines = new Pen(Color.Black);
gObject.FillRectangle(bg, new Rectangle(0,0,500,600));
gObject.DrawLine(lines, new Point(167,0), new Point(167,500));
gObject.DrawLine(lines, new Point(334,0), new Point(334,500));
gObject.DrawLine(lines, new Point(0,167), new Point(500,167));
gObject.DrawLine(lines, new Point(0,334), new Point(500,334));
}
}
}
Formulrio FORM1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace CSDGame
{
public partial class Form1 : Form
{
GFX engine;
public Form1()
{
InitializeComponent();
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
Graphics toPass = panel1.CreateGraphics();
engine = new GFX(toPass);
}
}
}