Added docs and layer support for UDP

This commit is contained in:
Devine Lu Linvega 2019-01-13 08:56:55 +12:00
parent dd549617b5
commit fc46080e4b
2 changed files with 11 additions and 0 deletions

View File

@ -16,6 +16,15 @@ npm install
npm start
```
## UDP Controls
Dotgrid can be controlled by UDP via the port `49160`. It expects messages of 6 characters.
- **layer** `0/1/2`
- **type** `l/a/r/c`
- **from** `0-z``0-z`
- **to** `0-z``0-z`
## Extras
- This application supports the [Ecosystem Theme](https://github.com/hundredrabbits/Themes).

View File

@ -18,6 +18,8 @@ function Listener (dotgrid) {
}
function operate (data) {
if(!dotgrid.tool.layers[data.layer]){ return }
dotgrid.tool.index = data.layer
dotgrid.tool.addSegment(data.type, [data.from, data.to])
dotgrid.renderer.update()
}