Hopefully a simple question
Monte Goulding
monte at sweattechnologies.com
Thu Sep 23 21:25:11 EDT 2010
> Would a datagrid be a better method for this? With a row template of 9 tile
> size images viewing 9 rows, and use fillindata to choose what imagadata to
> set each row tile to.. I was thinking this might work pretty well as I will
> only have to worry about the charoffset for each data row, and the datagrid
> will handle which rows are displayed.
Hi Mike
I'd suggest using 9 transparent buttons grouped and use icons and image names. Then your group could have get and setprop handlers to handle multi-dimensional arrays.
-- group script
getProp map
return the customProperties["map"] of me
end map
-- pMap is a multi-dimensional array representing your map
-- pMap[1][1] = the top left corner
-- btn names are 1,1.. 9,9
setProp map pMap
repeat with tRow = 1 to 3
repeat with tColumn = 1 to 3
set the icon of btn (tRow,tColumn) to the short id of image pMap[tRow][tColumn]
end repeat
end repeat
set the customProperties["map"] of me to pMap
end map
You could have a larger world map also and this 9x9 view could just display sections of it.
Cheers
--
Monte Goulding
M E R Goulding Software Development
Bespoke application development for vertical markets
InstallGadget - How to create an installer in 10 seconds
revObjective - Making behavior scripts behave
More information about the use-livecode
mailing list