Ok, time for an update on progress.
Note: These functions are all within the map object (created with .buildMap())
Culling is working just about perfectly (no bugs, no tile “leaks”) and is really amazing. Culling works faster the (a) larger tiles your map is made of (b) the less layers you have or © the less tiles you have (obviously). It’s pretty fast anyway, but it’s not such a good idea to use solid-colored-tile tiled backgrounds (repeating a solid colored tile to make a solid colored background), because it can slow down the culling engine part. Culling supports scaled maps - set your map xScale and yScale and then call resetVisible() and it’ll internally calculate the max visible tiles.
The camera system is working well, but it doesn’t support scaled maps. The map tracks an object specified with setCameraFocus(), sets bounds with setCameraBounds(), and moves+culls tiles with updateCamera().
You can lock tiles from being culled with setLock (iterates through chunk x1-x2, y1-y2). It takes five arguments. The first four are the dimensions of the chunk, and the last one is the lock state. A lock state of [lua]true[/lua] will lock tiles from being culled, and a lock state of [lua]false[/lua] will release any lock on the tiles. The lock state defaults to [lua]true[/lua].
You can manually draw tiles with draw(), manually erase tiles with erase(), and do auto-culling with render().
Alternatively, each layer (map.layer[index/key]) has their own versions of the drawing functions, so you can do them to a single layer with [lua]map.layer[“myLayer”].render()[/lua] or [lua]map.layer[1].render()[/lua].
Individual tile and object physics and properties are supported (edit tiles within a tileset or an object’s properties). Any property can be read as a table by starting the value out with [lua]!json![/lua] and then the value. So for a collision filter, you’d use this as your Tiled property:
[lua]
physics:filter :: !json!{“categoryBits”:2, “maskBits”:3}
[/lua]
(or something to that effect).
The type and name values for objects are stored in each object as “_type” and “_name”. If no name is found, it defaults to the shape + the object number; i.e. “rect5”.
Debug messages may be shown with [lua]ceramic.showPrints=true[/lua].
Single tiles are accessed with [lua]map.layer[“myLayer”].tile[x][y][/lua]. Single objects are accessed with [lua]map.layer[“myLayer”].object[“myObject”][/lua].
Each layer has two references; a numerical index and a string key equal to the layer’s name. Objects are done likewise; each object has an index reference and a key reference equal to their name.
That’s all the framework I can think of at the minute, but if I think of something else that’s really cool, I’ll comment again.