You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<scripttype="text/paperscript"canvas="canvas">// Create a raster item using the image with id='mona'var raster =newRaster('game');// Make the raster invisible:raster.visible=false;var lastPos =view.center;functionmoveHandler(event) {if (lastPos.getDistance(event.point) <10)return; lastPos =event.point;var size =this.bounds.size.clone();var isLandscape =size.width>size.height;// If the path is in landscape orientation, we're going to// split the path horizontally, otherwise vertically: size /= isLandscape ? [2, 1] : [1, 2];var path =newPath.Rectangle({ point:this.bounds.topLeft.floor(), size:size.ceil(), onMouseMove: moveHandler });path.fillColor=raster.getAverageColor(path);var path =newPath.Rectangle({ point: isLandscape?this.bounds.topCenter.ceil():this.bounds.leftCenter.ceil(), size:size.floor(), onMouseMove: moveHandler });path.fillColor=raster.getAverageColor(path);this.remove(); }functiononResize(event) {project.activeLayer.removeChildren();// Transform the raster so that it fills the bounding rectangle// of the view:raster.fitBounds(view.bounds, true);// Create a path that fills the view, and fill it with// the average color of the raster:newPath.Rectangle({ rectangle:view.bounds, fillColor:raster.getAverageColor(view.bounds), onMouseMove: moveHandler }); }</script>
<canvasid="canvas" resize></canvas>
<imgwidth="512"height="512"id="game"style="display: none;"src="{{url}}">
The problem is that it works at the first loading, but when I click the "next" button, nothing appears and I've no error in the console.
Hello, I use paperjs for the divisionRaster part but I have a problem.
I would like to dynamically change the divisionRaster with a button. I tried so many things but I can't manage to accomplish that.
Here is my code. It's split in two files.
index.html
And here is the /views/game/game.hbs file :
The problem is that it works at the first loading, but when I click the "next" button, nothing appears and I've no error in the console.
Here is a quick video to show https://youtu.be/kHNVNrePFl8
Thanks for your help
The text was updated successfully, but these errors were encountered: