Renamed JS folder and started learning Crystal

This commit is contained in:
plane000
2018-06-17 19:47:18 +01:00
parent 27998205c2
commit 348ba8e737
49 changed files with 4 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
const fs = require('fs');
const Jimp = require('jimp');
let str = 'Hello, world! ┌─-─┬ │ ♖ │ ♘ │ \n HEllo'
//let str ='┌─-─┬─-─┬─-─┬─-─┬─-─┬─-─┬─-─┬─-─┬─-─┐ \n' +
// '│ │ \n' +
// '├─-─╆━-━┿━-━┿━-━┿━-━┿━-━┿━-━┿━-━┿━-━┥ \n' +
// '| ┃ ♖ │ ♘ │ ♗ │ ♕ │ ♔ │ ♗ │ ♘ │ ♖ | \n' +
// '├─-─╂─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┤ \n' +
// '| ┃ ♙ │ ♙ │ ♙ │ ♙ │ ♙ │ ♙ │ ♙ │ ♙ | \n' +
// '├─-─╂─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┤ \n' +
// '| | \n' +
// '├─-─╂─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┤ \n' +
// '| | \n' +
// '├─-─╂─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┤ \n' +
// '| | \n' +
// '├─-─╂─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┤ \n' +
// '| | \n' +
// '├─-─╂─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┤ \n' +
// '| ┃ ♟ │ ♟ │ ♟ │ ♟ │ ♟ │ ♟ │ ♟ │ ♟ | \n' +
// '├─-─╂─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┼─-─┤ \n' +
// '| ┃ ♜ │ ♞ │ ♝ │ ♚ │ ♛ │ ♝ │ ♞ │ ♜ | \n' +
// '└─-─┸─-─┴─-─┴─-─┴─-─┴─-─┴─-─┴─-─┴─-─┘ \n';
Jimp.read("resources/start.png").then(function (image) {
image.resize(1200, 1200);
Jimp.loadFont(Jimp.FONT_SANS_32_BLACK).then(function (font) {
image.print(font, 10, 10, str);
image.write('resources/chess/img.png');
});
}).catch(function (err) {
console.error(err);
});
//var flag = new Jimp(200, 200, (err2, base) => {
// image.contain(604, 303, Jimp.RESIZE_BICUBIC, (err3, src) => {
// base.composite(src, 0, 88)
// .composite(background, 0, 0)
// .getBuffer(Jimp.MIME_PNG, (err4, buffer) => {
// //message.channel.send(new Discord.Attachment(buffer));
// });
// });
//});