I
thought I was going to need to resize the canvas downward, but after
centering, the images look more or less how I want, so why bother (and
likely will get more versatility from differing browsers if I don't, so
there are reasons against setting a static size).
Raster Initialization as a Function
This is a function (trial, will need to be refined) for use in initializing the Rasters.
// Initialize Small Rasters var smallRaster = []; var numSmallRaster = 18; // a magic number to be set manually var currentSmallRasterOne = 1; function initializeRaster(holdingArray, numRasters, imageName){
for (i = 1; i <= numRasters; i++){ // to += .png builds up the url variable var url = "images/montana/"; url += imageName; // end "O" or "OO" as needed if (i <= 9){ url += "00"; } else if (i <= 99){ url += "0"; } url += i; url += ".png"; // url variable completed holdingArray[i] = new paper.Raster(url, CP); holdingArray[i].size.width = 25; //holdingArray[i].size.height = 100; holdingArray[i].visible = false; url = ""; } // end for } // end initializeRaster Function
// call the function, to initialize small Rasters initializeRaster(smallRaster, numSmallRaster, "MontanaSmall");
Resizing the Raster
I
didn't even notice in the previous tutorial that the pictures were
getting cut off. They're still distorted with the code below, but
it's closer to what I want. Note: how sizes are relative to the
view.size.
Brett Words
my writing site (Home to the writing of Celli the Happy Go Lucky
Celaphopod, Eddie Takosori, Fritz Heinmillerstein, Morgan Feldstone,
Kevin Stillwater, and of course, me, your host, Brett Paufler)