newDirection(dir) {
        if (dir === this.direction) return;
        this.direction = dir;
        this.inp1.refresh();
        if (dir === "RIGHT" || dir === "LEFT") {
            this.inp1.leftx = 50 - this.xSize;
        } else if (dir === "UP") {
            this.inp1.leftx = 20;
        } else {
            this.inp1.leftx = 20;
        }
        // if(this.direction=="LEFT" || this.direction=="RIGHT") this.inp1.leftx=50-this.xSize;
        //     this.inp1.refresh();

        this.inp1.refresh();
    }
@memberof Flag
function to change direction of Flag
@param {string} dir - new direction