jonobr1 / two.js

A renderer agnostic two-dimensional drawing api for the web.
https://two.js.org
MIT License
8.3k stars 455 forks source link

Why is the drawing overwritten? #663

Closed landy101 closed 1 year ago

landy101 commented 2 years ago

I want to develop programs similar to CAD. The graphics are always covered. How can I solve this problem? thank you

this.electronArray.push( this._two.makeRectangle(X, Y, 300, 100) )

Do you have any examples similar to CAD? Dingtalk_20220825105402

jonobr1 commented 2 years ago
const rect = two.makeRectangle(x, y, 300, 100);
rect.noFill();
// or
rect.fill = 'transparent';

The default is that they are filled white. You can remove the fill with the above code.