Jump to content

how can I use mouse to draw a line


david43
 Share

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);

image.png.afe989f50884b9a92c51ea5f6f5227f0.png

image.png.f55b5c54a9a2364e8889a145d1e762c6.png

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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