Jump to content

how can I use mouse to draw a line


Recommended Posts

take a look in graphics features ,quadLinebezierCurvebezierLine, arc ...

some example here can help you to achieve what you want.

And use generate Texture to create a sprite.

let quadLine = new Graphics(); 
quadLine.lineStyle(4, 0x000000, 1); 
quadLine.moveTo(32, 128); 
quadLine.quadraticCurveTo(128, 20, 224, 128); stage.addChild(quadLine);



source: https://www.amazon.com/Learn-Pixi-js-Rex-van-Spuy/dp/1484210956

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...