Added a super guide function
This commit is contained in:
@@ -94,11 +94,17 @@ function Library (ronin) {
|
||||
return rect
|
||||
}
|
||||
|
||||
this.gradient = (line, colors = ['white', 'black']) => {
|
||||
this.gradient = (line, colors = ['white', 'black']) => { // Defines a gradient color.
|
||||
return ronin.surface.linearGradient(line.a.x, line.a.y, line.b.x, line.b.y, colors)
|
||||
}
|
||||
|
||||
this.guide = (shape) => { // Draws a shape on the guide layer.
|
||||
ronin.surface.drawGuide(shape)
|
||||
return shape
|
||||
}
|
||||
|
||||
this.clear = (rect = this.frame()) => { // Clears a rect.
|
||||
ronin.surface.clearGuide(rect)
|
||||
ronin.surface.clear(rect)
|
||||
return rect
|
||||
}
|
||||
|
||||
@@ -160,8 +160,8 @@ function Surface (ronin) {
|
||||
|
||||
this.drawGuide = function (shape, context = this.guide) {
|
||||
this.clearGuide()
|
||||
this.stroke(shape, 5, 'black', context)
|
||||
this.stroke(shape, 2, 'white', context)
|
||||
this.stroke(shape, 3, 'black', context)
|
||||
this.stroke(shape, 1.5, 'white', context)
|
||||
}
|
||||
|
||||
this.clone = function (a, b) {
|
||||
|
||||
Reference in New Issue
Block a user