()
| 715 | } |
| 716 | |
| 717 | public getGap(): number{ |
| 718 | // We find the perfect gap so that the player would be in the center |
| 719 | var gap: number = (this.renderArea.getWidth()-100) - (this.getGame().getPlayer().getGlobalPosition().x - 50)*2; |
| 720 | |
| 721 | // We possibly correct this gap to keep the quest in the center if the player is in the left or right of the quest |
| 722 | if(gap > (this.renderArea.getWidth()-100)) gap = (this.renderArea.getWidth()-100); |
| 723 | if(gap < -(this.renderArea.getWidth()-100)) gap = -(this.renderArea.getWidth()-100); |
| 724 | |
| 725 | // We return the possibly corrected gap |
| 726 | return gap; |
| 727 | } |
| 728 | |
| 729 | public getGlobalDrawingOffset(): Pos{ |
| 730 | return this.globalDrawingOffset; |
no test coverage detected