
-----------------------------------
user23
Wed Apr 27, 2011 7:01 pm

Simple way to draw a grid for minesweeper?
-----------------------------------
Whats the simplest way to draw a grid that looks like the one in minesweeper, that can add clickable functions and all alike?

-----------------------------------
apython1992
Wed Apr 27, 2011 7:06 pm

RE:Simple way to draw a grid for minesweeper?
-----------------------------------
Turing actually has a built-in GUI library, does it not?

-----------------------------------
Zren
Wed Apr 27, 2011 8:42 pm

Re: RE:Simple way to draw a grid for minesweeper?
-----------------------------------
Ooooor...Use Mouse.Where combined with some loops.


% make a rect type, then a getRect(col,row):rect function --> awesomeness
var r : rect
r.x1 := grid.x + col * grid.cellWidth
r.y1 := grid.y + row * grid.cellHeight
r.x2 := grid.x + col * grid.cellWidth + grid.cellWidth
r.y2 := grid.y + row * grid.cellHeight + grid.cellHeight

Mouse.Where (mouse.x, mouse.y, mouse.b)

% input/logic
var r : rect := calcRect (col, row)
if r.x1 