Improved docs

This commit is contained in:
Devine Lu Linvega 2019-07-28 13:23:09 +09:00
parent 7bd740f257
commit a340e2654b
2 changed files with 10 additions and 10 deletions

View File

@ -56,7 +56,7 @@ Ronin helpers are keywords that facilitates adding coordinates from the canvas i
- `(line ax ay bx by)` Returns a line shape. - `(line ax ay bx by)` Returns a line shape.
- `(text x y p t ~a ~f)` Returns a text shape. - `(text x y p t ~a ~f)` Returns a text shape.
- `(svg x y d)` Returns a svg shape. - `(svg x y d)` Returns a svg shape.
- `(offset a b)` Returns the offset between two pos. - `(offset a b)` Offsets pos a with pos b, returns a.
- `(stroke shape color ~thickness)` Strokes a shape. - `(stroke shape color ~thickness)` Strokes a shape.
- `(fill ~rect)` Fills a shape. - `(fill ~rect)` Fills a shape.
- `(gradient line ~colors 'black'])` Defines a gradient color. - `(gradient line ~colors 'black'])` Defines a gradient color.
@ -88,13 +88,13 @@ Ronin helpers are keywords that facilitates adding coordinates from the canvas i
- `(mod a b)` Returns the modulo of a and b. - `(mod a b)` Returns the modulo of a and b.
- `(clamp val min max)` Clamps a value between min and max. - `(clamp val min max)` Clamps a value between min and max.
- `(step val step)` - `(step val step)`
- `(min)` - `(min)` Clamp value from.
- `(max)` - `(max)` Clamp value at.
- `(ceil)` - `(ceil)` Round up to the nearest integer.
- `(floor)` Round down to the nearest integer. - `(floor)` Round down to the nearest integer.
- `(sin)` - `(sin)`
- `(cos)` - `(cos)`
- `(log)` Caclulates on the base of e. - `(log)` Caclulates on the base.
- `(pow a b)` Calculates a^b. - `(pow a b)` Calculates a^b.
- `(sqrt)` Calculate the square root. - `(sqrt)` Calculate the square root.
- `(sq a)` Calculate the square. - `(sq a)` Calculate the square.

View File

@ -82,7 +82,7 @@ function Library (ronin) {
return { x, y, d } return { x, y, d }
} }
this.offset = (a, b) => { // Returns the offset between two pos. this.offset = (a, b) => { // Offsets pos a with pos b, returns a.
a.x += b.x a.x += b.x
a.y += b.y a.y += b.y
return a return a
@ -266,11 +266,11 @@ function Library (ronin) {
return Math.round(val / step) * step return Math.round(val / step) * step
} }
this.min = Math.min this.min = Math.min // Clamp value from.
this.max = Math.max this.max = Math.max // Clamp value at.
this.ceil = Math.ceil this.ceil = Math.ceil // Round up to the nearest integer.
this.floor = Math.floor // Round down to the nearest integer. this.floor = Math.floor // Round down to the nearest integer.
@ -278,7 +278,7 @@ function Library (ronin) {
this.cos = Math.cos this.cos = Math.cos
this.log = Math.log // Caclulates on the base of e. this.log = Math.log // Caclulates on the base.
this.pow = (a, b) => { // Calculates a^b. this.pow = (a, b) => { // Calculates a^b.
return Math.pow(a, b) return Math.pow(a, b)