easelJS를 사용하여 한 줄에 흐림 효과를 추가하려고합니다. 필자는 createJS 문서에서 BlurFilter 데모를 따르고 있습니다 (단, 줄 대신 원을 사용한다는 점을 제외하고는). shape.cache 호출을 제거하지 않으면 내 모양이 완전히 사라집니다. 줄이 가능합니까 아니면 모양이 흐리게 흐릿합니까?EaselJS - 라인에 BlurFilter를 추가 할 수 있습니까?
function drawShape() {
var shape = new createjs.Shape();
shape.graphics.setStrokeStyle(10, "round")
.beginStroke(colorPalette.shape[0])
.beginFill(colorPalette.shape[0])
.moveTo(200,400)
.lineTo(1500,400);
shape.cursor = "pointer";
var blurFilter = new createjs.BlurFilter(50, 50, 1);
shape.filters = [blurFilter];
var bounds = blurFilter.getBounds();
shape.cache(-50+bounds.x, -50+bounds.y, 100+bounds.width, 100+bounds.height); // Code works if I remove this line
updateStage(shape); // Utility function that calls addChild and update on stage
}
<body onload="init()" onresize="resize()">
<!-- App -->
<canvas id="canvas"></canvas>
</body>
고맙습니다! 몇 시간 동안 내 머리를 두드리는 소리가났다. –