init() {
        window.addEventListener("resize",
            this.aspectRatio.bind(this),
            false)
        window.addEventListener("keyup", (e) => {
            switch (e.keyCode) {
                case 32:
                    this.pause()
                    break;
                case 37:
                    this.zoom.stepDown()
                    break;
                case 39:
                    this.zoom.stepUp()
                    break;
                case 40:
                    this.zoom.value = 0
                    break;
                case 82:
                    this.zoom.value = 0
                    this.context.setTransform(1, 0, 0, 1, 0, 0)
                    this.draw(1e-30)
                    break;

                default:
                    break;
            }
        })
        this.aspectRatio()
        this.loop()
    }
/**
     * Manage resizing and pausing of renderer.
     */
Manage resizing and pausing of renderer.
Manage resizing and pausing of renderer .
init() {
        window.addEventListener("resize",
            this.aspectRatio.bind(this),
            false)
        window.addEventListener("keyup", (e) => {
            switch (e.keyCode) {
                case 32:
                    this.pause()
                    break;
                case 37:
                    this.zoom.stepDown()
                    break;
                case 39:
                    this.zoom.stepUp()
                    break;
                case 40:
                    this.zoom.value = 0
                    break;
                case 82:
                    this.zoom.value = 0
                    this.context.setTransform(1, 0, 0, 1, 0, 0)
                    this.draw(1e-30)
                    break;
                default:
                    break;
            }
        })
        this.aspectRatio()
        this.loop()
    }
init ( ) { window . addEventListener ( "resize" , this . aspectRatio . bind ( this ) , false ) window . addEventListener ( "keyup" , ( e ) => { switch ( e . keyCode ) { case 32 : this . pause ( ) break ; case 37 : this . zoom . stepDown ( ) break ; case 39 : this . zoom . stepUp ( ) break ; case 40 : this . zoom . value = 0 break ; case 82 : this . zoom . value = 0 this . context . setTransform ( 1 , 0 , 0 , 1 , 0 , 0 ) this . draw ( 1e-30 ) break ; default : break ; } } ) this . aspectRatio ( ) this . loop ( ) }
Manage resizing and pausing of renderer.
Manage resizing and pausing of renderer .