Updated docs
This commit is contained in:
parent
2c93193434
commit
5d1d94415e
33
README.md
33
README.md
@ -30,13 +30,21 @@ Additional functions can be found in the [includes](https://github.com/hundredra
|
|||||||
- `(import path rect)` Imports a graphic file with format.
|
- `(import path rect)` Imports a graphic file with format.
|
||||||
- `(export path ~format ~quality)` Exports a graphic file with format.
|
- `(export path ~format ~quality)` Exports a graphic file with format.
|
||||||
- `(open path)` Imports a graphic file and resizes the frame.
|
- `(open path)` Imports a graphic file and resizes the frame.
|
||||||
- `(pos x y ~t)` Returns a position shape.
|
- `(move x y)`
|
||||||
- `(size w h ~t)` Returns a size shape.
|
- `(rotate angle)`
|
||||||
- `(rect x y w h ~t)` Returns a rect shape.
|
- `(scale x y)`
|
||||||
- `(circle x y r ~t)` Returns a circle shape.
|
- `(transform a b c d e f)`
|
||||||
- `(line a b ~t)` Returns a line shape.
|
- `(setTransform a b c d e f)`
|
||||||
- `(text x y g s ~f ~t)` Returns a text shape.
|
- `(resetTransform)`
|
||||||
- `(svg d ~t)` Returns a svg shape.
|
- `(pushTransform)`
|
||||||
|
- `(popTransform)`
|
||||||
|
- `(pos x y)` Returns a position shape.
|
||||||
|
- `(size w h)` Returns a size shape.
|
||||||
|
- `(rect x y w h)` Returns a rect shape.
|
||||||
|
- `(circle cx cy r)` Returns a circle shape.
|
||||||
|
- `(line a b)` Returns a line shape.
|
||||||
|
- `(text x y p t ~f)` Returns a text shape.
|
||||||
|
- `(svg d)` Returns a svg shape.
|
||||||
- `(stroke ~shape)` Strokes a shape.
|
- `(stroke ~shape)` Strokes a shape.
|
||||||
- `(fill ~rect)` Fills a shape.
|
- `(fill ~rect)` Fills a shape.
|
||||||
- `(clear ~rect)` Clears a rect.
|
- `(clear ~rect)` Clears a rect.
|
||||||
@ -82,22 +90,27 @@ Additional functions can be found in the [includes](https://github.com/hundredra
|
|||||||
- `(rest [_ ...arr])`
|
- `(rest [_ ...arr])`
|
||||||
- `(range start end ~step)`
|
- `(range start end ~step)`
|
||||||
- `(get item key)` Gets an object's parameter with name.
|
- `(get item key)` Gets an object's parameter with name.
|
||||||
- `(set item key val)` Sets an object's parameter with name as value.
|
- `(set item ...args)` Sets an object's parameter with name as value.
|
||||||
- `(of h ...keys)` Gets object parameters with names.
|
- `(of h ...keys)` Gets object parameters with names.
|
||||||
- `(keys item)` Returns a list of the object's keys
|
- `(keys item)` Returns a list of the object's keys
|
||||||
- `(values item)` Returns a list of the object's values
|
- `(values item)` Returns a list of the object's values
|
||||||
|
- `(convolve rect kernel)`
|
||||||
|
- `(blur)`
|
||||||
|
- `(sharpen)`
|
||||||
|
- `(edge)`
|
||||||
- `(dir ~path)` Returns the content of a directory.
|
- `(dir ~path)` Returns the content of a directory.
|
||||||
- `(file ~path)` Returns the content of a file.
|
- `(file ~path)` Returns the content of a file.
|
||||||
- `(dirpath ~path)` Returns the path of a directory.
|
- `(dirpath ~path)` Returns the path of a directory.
|
||||||
- `(filepath ~path)` Returns the path of a file.
|
- `(filepath ~path)` Returns the path of a file.
|
||||||
- `(exit ~force)` Exits Ronin.
|
- `(exit ~force)` Exits Ronin.
|
||||||
- `(echo ...args)`
|
- `(echo ...args)`
|
||||||
|
- `(table arg)`
|
||||||
|
- `(debug arg)`
|
||||||
- `(time ~rate)` Returns timestamp in milliseconds.
|
- `(time ~rate)` Returns timestamp in milliseconds.
|
||||||
- `(animate ~play)` Toggles animation.
|
|
||||||
- `(js)` Javascript interop.
|
- `(js)` Javascript interop.
|
||||||
|
- `(on event f)` Triggers on event.
|
||||||
- `(test name a b)`
|
- `(test name a b)`
|
||||||
- `(benchmark fn)` logs time taken to execute a function.
|
- `(benchmark fn)` logs time taken to execute a function.
|
||||||
- `(osc ~address)` returns the last received osc msg on port 12940
|
|
||||||
|
|
||||||
## Extras
|
## Extras
|
||||||
|
|
||||||
|
@ -441,7 +441,7 @@ function Library (ronin) {
|
|||||||
return window
|
return window
|
||||||
}
|
}
|
||||||
|
|
||||||
this.on = (event, f) => {
|
this.on = (event, f) => { // Triggers on event.
|
||||||
ronin.bind(event, f)
|
ronin.bind(event, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,10 +460,4 @@ function Library (ronin) {
|
|||||||
console.log(`time taken: ${Date.now() - start}ms`)
|
console.log(`time taken: ${Date.now() - start}ms`)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// IO
|
|
||||||
|
|
||||||
this.osc = (path) => { // Returns the latest osc message at path
|
|
||||||
return path ? ronin.osc.msg[path] : ronin.osc.msg
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user