Taribuna Posted December 11, 2019 Share Posted December 11, 2019 Hello, I am trying to port a coloring book "game" from phaser 2 to phaser 3. Now in the original we used to do a simpe draw with the mouse using: var canvas = this.make.bitmapData(800, 600); var ctx = canvas.ctx; ctx.lineWidth = 20; ctx.lineJoin = ctx.lineCap = 'round'; ctx.strokeStyle = '#000000'; // and then in the mouse move function ctx.beginPath(); ctx.moveTo(last_pos.x, last_pos.y); ctx.lineTo(pointer.x, pointer.y); ctx.stroke(); ctx.closePath(); Now in the new Graphics Class I did not find a way to set the lineCap to round. Hence when I run: var canvas = this.add.graphics(); canvas.lineStyle(20, 0x000000, 1); canvas.beginPath(); canvas.moveTo(drawpoint.x, drawpoint.y); canvas.lineTo(pointer.x,pointer.y); canvas.fillPath() canvas.strokePath(); canvas.closePath(); i am not getting a nice smooth line but rather the very jagged path that I would get if I did not set lineCap to "round" in the old version. Any Ideas what I could do? thanks! Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.