Changed export def
This commit is contained in:
parent
965c071aed
commit
0fc8103e7a
@ -61,7 +61,7 @@ Library
|
||||
|
||||
- (open name ~scale) Imports a graphic file with format.
|
||||
- (import name ~shape) Imports a graphic file with format.
|
||||
- (export ~name ~format ~quality) Exports a graphic file with format.
|
||||
- (export ~format ~quality) Exports a graphic file with format.
|
||||
- (print string) Exports string to file.
|
||||
- (pos ~x ~y) Returns a position shape.
|
||||
- (line ax ay bx by) Returns a line shape.
|
||||
|
@ -896,9 +896,9 @@ function Library (client) {
|
||||
client.surface.draw(img, shape, alpha)
|
||||
return shape || this.rect(0, 0, img.width, img.height)
|
||||
}
|
||||
this.export = (name = 'ronin', type = 'image/png', quality = 1.0) => { // Exports a graphic file with format.
|
||||
const ext = type === 'image/png' ? name + '.png' : name + '.jpg'
|
||||
client.source.write(name, ext, client.surface.el.toDataURL(type, quality), type)
|
||||
this.export = (format = 'jpg', quality = 0.9) => { // Exports a graphic file with format.
|
||||
const type = `image/${format === 'jpeg' || format === 'jpg' ? 'jpeg' : 'png'}`
|
||||
client.source.write('ronin', format, client.surface.el.toDataURL(type, quality), type)
|
||||
}
|
||||
this.pos = (x = 0, y = 0) => { // Returns a position shape.
|
||||
return { x, y }
|
||||
|
@ -20,9 +20,9 @@ function Library (client) {
|
||||
return shape || this.rect(0, 0, img.width, img.height)
|
||||
}
|
||||
|
||||
this.export = (name = 'ronin', type = 'image/png', quality = 1.0) => { // Exports a graphic file with format.
|
||||
const ext = type === 'image/png' ? name + '.png' : name + '.jpg'
|
||||
client.source.write(name, ext, client.surface.el.toDataURL(type, quality), type)
|
||||
this.export = (format = 'jpg', quality = 0.9) => { // Exports a graphic file with format.
|
||||
const type = `image/${format === 'jpeg' || format === 'jpg' ? 'jpeg' : 'png'}`
|
||||
client.source.write('ronin', format, client.surface.el.toDataURL(type, quality), type)
|
||||
}
|
||||
|
||||
// Shapes
|
||||
|
Loading…
x
Reference in New Issue
Block a user