How to use the pts/dist/es5.Triangle.fromCenter function in pts

To help you get started, we’ve selected a few pts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github williamngan / pts-react-example / create_react_app_example / src / PtsExamples.jsx View on Github external
drawButton() {
    if (!this.bufferLoaded) {
      this.form.fillOnly("#9ab").text( [20,30], "Loading..." );
      return;
    }
    if (!this.sound || !this.sound.playing) {
      this.form.fillOnly("#f06").rect( [[0,0], [50,50]] );
      this.form.fillOnly('#fff').polygon( Triangle.fromCenter( [25,25], 10 ).rotate2D( Const.half_pi, [25,25] ) );
    } else {
      this.form.fillOnly("rgba(0,0,0,.2)").rect( [[0,0], [50,50]] );
      this.form.fillOnly("#fff").rect( [[18, 18], [32,32]] );
    }
  }