Thanks. You are right.
I just had to initialize colcount / rowcount.
And remove that, because its useless now:
kgrid1.ColCount:=992 div kgrid1.rowCount
It works fine. I still have few things to make, but its too late atm, gtg to sleep.
And yesterday i also added a "nice feature" that moves scrollbars away from tiles.
Otherwise the grid scrollbars would hide some of the tiles. But i just made the form bigger, by getting scrollbar width/height from windows and passing it to my code.
I later will show it.
Btw just one more question:
I have currently dynamic 2D array, called tilesheet of integers, i set its length according to numcols and numrows. And then i do:
Code:
KGrid1.CellPainter.Canvas.Draw(R.Left, R.Top, sty.getTile( TileSheet[ARow , ACol ]));
sty.getTile just waits for the tile_id (integer).
Is it possible to draw all these tiles (992) without that "tilesheet" array?
Bookmarks