[Paul Ferrie ]
12-03-2009, 04:35 PM
Ah there is some PV3D (http://blog.papervision3d.org/) stuff there. That's something I've not looked at yet. AS for the images loading in the way they are. I can show you how i think the grid is produced but the rest is up to yourself.
This code has just been quickly put together as a starting point
Where there is a number 2 in the array this could be where you would hold the variable that is the path to your image
var imageMap:Array = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
var i:Number = 0;
var j:Number = 0;
var mapW:Number = imageMap[0].length;
var mapH:Number = imageMap.length;
var tileW:Number = 30;
var tileH:Number = 16;
var startX:Number = 6;
var startY:Number = 23;
function buildMap() {
for (i=0; i<mapH; i++) {
for (j=0; j<mapW; j++) {
holder.attachMovie("cell","c_"+i+"_"+j,holder.getNextHighestDepth());
holder["c_"+i+"_"+j]._x = startX+j*tileW;
holder["c_"+i+"_"+j]._y = startY+i*tileH;
holder["c_"+i+"_"+j].gotoAndStop(imageMap[i][j]);
}
}
}
buildMap()
I've also attached the source.
Hope it helps.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.