diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-01-29 06:56:21 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-01-29 06:56:21 +0800 |
commit | 42b7d4ff248e3832c792d37034fad076861dac28 (patch) | |
tree | 62d9bcc1e3525d3721d606a0960521c8e5fee2a5 /features/hud/HudTextElement.js | |
parent | dc4a2cb096b3fd7ddb7d133853f6a5436026b2ca (diff) | |
download | SoopyV2-42b7d4ff248e3832c792d37034fad076861dac28.tar.gz SoopyV2-42b7d4ff248e3832c792d37034fad076861dac28.tar.bz2 SoopyV2-42b7d4ff248e3832c792d37034fad076861dac28.zip |
blaze solver + make spotify box go to width of the max scroll + normalise text on spotify overlay so it doesent render an invalid caracter when the text has a dialect or something
Diffstat (limited to 'features/hud/HudTextElement.js')
-rw-r--r-- | features/hud/HudTextElement.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/features/hud/HudTextElement.js b/features/hud/HudTextElement.js index 5599b5c..8177c43 100644 --- a/features/hud/HudTextElement.js +++ b/features/hud/HudTextElement.js @@ -10,9 +10,22 @@ class HudTextElement{ this.editTempTimeV = 0 this.editTempTextV = undefined + this.editBaseWidth = undefined + this.editBaseHeight = undefined + this.tempDisableTime = 0 } + setBaseEditWidth(width){ + this.editBaseWidth = width + return this + } + + setBaseEditHeight(height){ + this.editBaseHeight = height + return this + } + setText(text){ this.text = text @@ -42,10 +55,12 @@ class HudTextElement{ this.renderRaw() } - getWidth(){ + getWidth(locationBox=false){ + if(locationBox && this.editBaseWidth) return this.editBaseWidth return Math.max(...(this.getText()[0].map(a=>Renderer.getStringWidth(ChatLib.removeFormatting(a))))) } - getHeight(){ + getHeight(locationBox=false){ + if(locationBox && this.editBaseHeight) return this.editBaseHeight return 9*this.getText()[0].length } |