nft-art-engine
Advanced tools
Comparing version 0.1.17 to 0.1.18
@@ -70,3 +70,3 @@ export interface dimention { | ||
whitelist?: whiteList; | ||
sign?: sign; | ||
sign?: sign[]; | ||
} | ||
@@ -80,3 +80,3 @@ | ||
whitelist?: whiteList; | ||
sign?: sign; | ||
sign?: sign[]; | ||
} | ||
@@ -92,3 +92,3 @@ | ||
layers: layer[]; | ||
sign?: sign; | ||
sign?: sign[]; | ||
} | ||
@@ -95,0 +95,0 @@ |
36
index.js
@@ -11,7 +11,9 @@ const fs = require("fs"); | ||
_ctx.fillStyle = _sign.fillStyle; | ||
_ctx.font = _sign.font; | ||
_ctx.textBaseline = _sign.textBaseline; | ||
_ctx.textAlign = _sign.textAlign; | ||
_ctx.fillText(_sign.signature, _sign.position.x, _sign.position.y); | ||
_sign.forEach(sign => { | ||
_ctx.fillStyle = sign.fillStyle; | ||
_ctx.font = sign.font; | ||
_ctx.textBaseline = sign.textBaseline; | ||
_ctx.textAlign = sign.textAlign; | ||
_ctx.fillText(sign.signature, sign.position.x, sign.position.y); | ||
}); | ||
}; | ||
@@ -169,4 +171,8 @@ | ||
async function generate(_config, _callback) { | ||
if (_config.sign && _config.sign.registerFont) { | ||
registerFont(_config.sign.registerFont.path, _config.sign.registerFont.fontFace) | ||
if (_config.sign) { | ||
_config.sign.forEach(sign => { | ||
if (sign.registerFont) { | ||
registerFont(sign.registerFont.path, sign.registerFont.fontFace) | ||
} | ||
}); | ||
} | ||
@@ -221,4 +227,8 @@ | ||
async function extend(_config) { | ||
if (_config.sign && _config.sign.registerFont) { | ||
registerFont(_config.sign.registerFont.path, _config.sign.registerFont.fontFace) | ||
if (_config.sign) { | ||
_config.sign.forEach(sign => { | ||
if (sign.registerFont) { | ||
registerFont(sign.registerFont.path, sign.registerFont.fontFace) | ||
} | ||
}); | ||
} | ||
@@ -248,4 +258,8 @@ | ||
async function preview(_config) { | ||
if (_config.sign && _config.sign.registerFont) { | ||
registerFont(_config.sign.registerFont.path, _config.sign.registerFont.fontFace) | ||
if (_config.sign) { | ||
_config.sign.forEach(sign => { | ||
if (sign.registerFont) { | ||
registerFont(sign.registerFont.path, sign.registerFont.fontFace) | ||
} | ||
}); | ||
} | ||
@@ -252,0 +266,0 @@ |
{ | ||
"name": "nft-art-engine", | ||
"version": "0.1.17", | ||
"version": "0.1.18", | ||
"description": "NFT ART Engine is a package used to create multiple different instances of artworks based on provided layers.", | ||
@@ -5,0 +5,0 @@ "author": "Bagus Abdul Kurniawan", |
234671
341