Update:
We now have full tileset support -- both graphical and ASCII.
Fixed the "preview" tiles for when one is selected.
Tweaked the ASCII graphics a little (we had character "bleed" with one bad putimage placement earlier by a pixel.)
*************************
*************************
This has actually been quite a difficult little update, just to get everything to play nice together and display in the proper places, with the main issue being that TYPEs don't allow arrays.
TYPE TileInfo
TileSet1 AS STRING * 30
X1 AS _UNSIGNED _BYTE
Y1 AS _UNSIGNED _BYTE
TileSet2 AS STRING * 30
X2 AS _UNSIGNED _BYTE
Y2 AS _UNSIGNED _BYTE
TileSet3 AS STRING * 30
X3 AS _UNSIGNED _BYTE
Y3 AS _UNSIGNED _BYTE
The map should work for us with 3 different tile sets for each tile (well, up to the 100 max tilesets per map limit -- if you need more than 100 tile sets, then you're doing something wrong, IMHO. Most maps get by quite well with just one...), as well as being able to layer 3 different things on that tile for background, foreground, effect. (Think grassy area, with hero standing on it, on fire...)
Since types don't allow arrays, there's been a lot of copy/pasting of code, with minor tweaks, to try and get everything to appear and display properly on the map. I won't promise that EVERYTHING lines up exactly as it should -- there's always a chance that you'll have a piece set for layer 2 appear on layer 1 (or 3) -- but I promise that I *TRIED* to fox all those instances. If you do manage to find a case where things get criss-crossed and don't appear to be working as intended, kindly report it and I'll scratch my head and cry, trying to sort out what I missed...
To give an indication of how mind-numbing some of this copy/paste code is, here's one of the nice segments to muddle through:
tx = Tile(TilesChosen(1).X, TilesChosen(1).Y).X2: ty = Tile(TilesChosen(1).X, TilesChosen(1).Y).Y2
IF Tile
(TilesChosen
(i
).X
, TilesChosen
(i
).Y
).X2
<> tx
THEN TileMatch
= 0:
EXIT FOR IF Tile
(TilesChosen
(i
).X
, TilesChosen
(i
).Y
).Y2
<> ty
THEN TileMatch
= 0:
EXIT FOR
Now, that's for the SECOND tileset... For the third, you'd need to change X2 to X3, Y2 to Y3, but NOT change the X or Y.... And if course, the index for SetXYCaption has to change from 2 to 3....
/cry!!
So anywho.....
I *think* I've caught all the various cases here and we're being layered properly, for both the ASCII (built in tile set) tile set, and any user-loaded tile sets.
****************************
****************************
Only real note that I'd like to point out to help people make certain that their loaded tile set works (such as the D32x32.png set I'm including in the archive) --
be certain to set the TX (Tile width, or x-size) and TY (Tile height, or y-size), or else you'll be using (0 height, 0 width) tiles to draw your map....