Sahli/ansilove.js/example/example_usage.ans
Iam Naughton Phier 413a4dad3e Adding ansilove.js
- admittedly this should probably be tracked via a link but
 ... not really sure how to do that and the last time I did it,
 I had massive issues with updating on other machines.
2014-10-10 00:57:21 +03:00

25 lines
No EOL
1.5 KiB
Text
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[?33hAnsiLove.render("cl!-al02.ans", function (canvas, sauce) {
document.getElementById("ansi-container").appendChild(canvas);
console.log(sauce);
}, {"bits": "9"});
// And for producing extremely long files,
// spanning multiple canvas elements by splitting every nth row...
[?33hAnsiLove.splitRender("long_ansi.ans", function (canvases, sauce) {
canvases.forEach(function (canvas) {
canvas.style.verticalAlign = "bottom"; // For perfect, gap-less viewing
document.getElementById("ansi-container").appendChild(canvas);
});
console.log(sauce);
}, 27, {"bits": "8"});
// And for ansimations...
var controller = [?33hAnsiLove.animate("ansimation.ans", function (canvas, sauce) {
document.getElementById("ansi-container").appendChild(canvas);
console.log(sauce);
controller.play(2800, function () {
console.log("Finished Playing");
});
}, {"bits": "9"});