The functionality described in m.builder.js is used to construct vertex buffer objects of quads for rendering sprites.
please.builder.SpriteBuilder (center, resolution)
The SpriteBuilder object is used to programatically generate a drawable object. The constructor arguments ‘center’ and ‘resolution’ are optional and may be omitted. They default to ‘false’ and 64 respectively.
If ‘center’ is true, then a quad’s position relative to (0,0) will be measured from its center, otherwise it will be measured from it’s bottom left corner.
To use the builder object, the “add_flat” method is called to add quads to the final object, and the “build” method is used to compile and return the vertex and index buffer objects to be used for rendering elsewhere.
The “add_flat” method takes the following arguments:
The “build” method takes no arguments and returns an object with the properties “vbo” and “ibo”.