mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-02-03 22:55:43 +00:00
add more ansii image methods for animation. fix test.
This commit is contained in:
parent
2a8f232d18
commit
89debe2577
@ -1493,6 +1493,9 @@ installed.
|
|||||||
- __setImage(file)__ - Set the image in the box to a new path. File can be a
|
- __setImage(file)__ - Set the image in the box to a new path. File can be a
|
||||||
path, url, or buffer.
|
path, url, or buffer.
|
||||||
- __clearImage()__ - Clear the image.
|
- __clearImage()__ - Clear the image.
|
||||||
|
- __play()__ - Play animation if it has been paused or stopped.
|
||||||
|
- __pause()__ - Pause animation.
|
||||||
|
- __stop()__ - Stop animation.
|
||||||
|
|
||||||
|
|
||||||
#### OverlayImage (from Box)
|
#### OverlayImage (from Box)
|
||||||
|
@ -118,7 +118,20 @@ ANSIImage.prototype.setImage = function(file) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ANSIImage.prototype.play = function() {
|
||||||
|
return this.img.play();
|
||||||
|
};
|
||||||
|
ANSIImage.prototype.pause = function() {
|
||||||
|
return this.img.pause();
|
||||||
|
};
|
||||||
|
ANSIImage.prototype.stop = function() {
|
||||||
|
return this.img.stop();
|
||||||
|
};
|
||||||
|
|
||||||
ANSIImage.prototype.clearImage = function() {
|
ANSIImage.prototype.clearImage = function() {
|
||||||
|
if (this.img && this.img.frames) {
|
||||||
|
this.stop();
|
||||||
|
}
|
||||||
this.setContent('');
|
this.setContent('');
|
||||||
this.img = null;
|
this.img = null;
|
||||||
this.cellmap = null;
|
this.cellmap = null;
|
||||||
|
@ -61,7 +61,7 @@ var url = 'https://people.mozilla.org/~dolske/apng/spinfox.png';
|
|||||||
if (!file) {
|
if (!file) {
|
||||||
try {
|
try {
|
||||||
if (!fs.existsSync(spinfox)) {
|
if (!fs.existsSync(spinfox)) {
|
||||||
var buf = blessed.png.curl(url);
|
var buf = blessed.ansiimage.curl(url);
|
||||||
fs.writeFileSync(spinfox, buf);
|
fs.writeFileSync(spinfox, buf);
|
||||||
}
|
}
|
||||||
file = spinfox;
|
file = spinfox;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user