Repository navigation
Slightly more advanced API usage
Here is some thigns that the average mod might never use or use very little of.
So, here are some cool functions your mod can use in the return table to create some cool effects:
This function is called when a user places a cell. It gets the id of the cell that was pressed, the x it was placed on, the y it was placed on, a table containing the properties of the cell before it, and the initial at that position before it (as mods might be interested in what was there saved in the initial before it was overwritten as onPlace is called after the cell is overwritten and the cell in initial is overwritten)
This method from your mod is called after all rendering is done. It can render on top of EVERYTHING.
This function has 4 parameters. The ID of the cell it has rendered, the x, the y, and the direction. This is called after the cell is rendered. If you use Love2D's functions for rendering in this function, you can draw on top of cells, which is pretty cool.
Called when a user resets the grid to the initial state (using the reset button).
Called when the user sets initial using the Set Initial button.
Called when the user clears the grid.
Called when the user scrolls the mouse cursor. This one has 2 parameters, the x and the y, which are basically the amount.
Called when a cell is generated by a generator cell. Has 6 parameters, gets the generator id, its x, its y, the id of what was generated, its x, its y.
Called when the user presses the pause/unpause button to pause/unpause the game.
Called when the user presses a mouse button. Has 5 arguments, the x of the mouse, the y of the mouse, the button pressed, if it was a touch and how many presses where done at a time.
Called when the user releases a mouse button. Has 5 arguments, the x of the mouse, the y of the mouse, the button pressed, if it was a touch and how many presses where released at a time.