I’m trying to create a grid for a game using the Moai SDK. Each tile in the grid should have the ability to be filled with a color.
So actually I have two questions:
- What is the best way to build a grid using Moai
- How can I fill each tile individually with a color

Thanks
Moai has an object for creating grids: MOAIGrid. Using the framework’s
jargon, you create a grid and give it a deck. Then you attach it to a prop and
add the prop to a layer. (That layer also needs a viewport which is attached
to a window.)
A Moai deck is an image or collection of images. If you wanted your
tiles to be different colors then you would create a deck with images of the
square in those colors.
Example
This code will create a 4×4 grid in a window:
After that, if you want to change the color of a specific cell, use the
setTilemethod to choose which item in the deck that cell uses.