I'm using a loop to push a number of views to an array. Attached to each view is a modifier and a surface.
var surfaces = [];
for(var i = 0; i<8; i++) {
var gridSurfaceView = new View();
var gridSurface = new Surface({
size: [25, 25],
content: "hello" + i,
})
var gridSurfaceMod = new Modifier({
origin: [0.5,0.5],
align: [0.5,0.5]
})
gridSurfaceView.add(gridSurfaceMod).add(gridSurface);
surfaces.push(gridSurfaceView);
}
I want to access the content of the surfaces within the surfaces array. I was hoping that this would happen:
surfaces[0].getContent() //returns hello0
surfaces[1].getContent() //returns hello1
But of course it won't, because each cell in surfaces is a view, not a surface.
Is there anyway to access these surfaces from this array?