我该怎么做呢?
我试过了,但是没有效果。
var spriteSheet = new createjs.SpriteSheet({
framerate: 60,
"images": [loader.getResult("ball")],
"frames": {"regX": 32, "height": 64, "regY": 32, "width": 64},
// define two animations, run (loops, 1.5x speed) and jump (returns to run):
"animations": {
"run": [0, 63, "run", 1.5]
}
});
ball = new createjs.Sprite(spriteSheet,"run")
ball.x = 50;
ball.y = 50;
ball.filters = [
new createjs.ColorFilter(0,1,1,1, 0,0, 0,0) // has no effect
];
stage.addChild(ball);stackoverflow希望我在发布这篇文章之前发布更多详细信息
图像是黑白的,我想把它着色,就像我想丢弃红色通道一样,所以RGB(155,155,155)变成了RGB(0,155,155)
发布于 2015-07-08 04:56:59
你忘了cache了。例如,如果ball为100x100,则可以使用以下代码:
ball = new createjs.Sprite(spriteSheet,"run")
ball.x = 50;
ball.y = 50;
ball.filters = [
new createjs.ColorFilter(0,1,1,1, 0,0, 0,0) // has no effect
];
ball.cache(0,0, 100, 100);
stage.addChild(ball);https://stackoverflow.com/questions/31166857
复制相似问题