aboutsummaryrefslogtreecommitdiff
path: root/features/hud/HudTextElement.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-03-18 21:09:00 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-03-18 21:09:00 +0800
commit61f813aa1ab67ffcf0be66e6690c04a1c501c21e (patch)
treeec7da085e65c31d52749adb87582740f2bed5157 /features/hud/HudTextElement.js
parentec8b3332001fda2763e0627e031758c68340024f (diff)
downloadSoopyV2-61f813aa1ab67ffcf0be66e6690c04a1c501c21e.tar.gz
SoopyV2-61f813aa1ab67ffcf0be66e6690c04a1c501c21e.tar.bz2
SoopyV2-61f813aa1ab67ffcf0be66e6690c04a1c501c21e.zip
- fix dungeon map heads not loading
- potential fix features breaking when first loading in
Diffstat (limited to 'features/hud/HudTextElement.js')
-rw-r--r--features/hud/HudTextElement.js45
1 files changed, 24 insertions, 21 deletions
diff --git a/features/hud/HudTextElement.js b/features/hud/HudTextElement.js
index 8177c43..2acbe67 100644
--- a/features/hud/HudTextElement.js
+++ b/features/hud/HudTextElement.js
@@ -82,28 +82,31 @@ class HudTextElement{
}
renderRaw(){
- let [text, blackText] = this.getText()
+ try{
+ let [text, blackText] = this.getText()
+
+ text.forEach((line, i)=>{
+ Renderer.scale(this.locationSetting.scale, this.locationSetting.scale)
+ switch(this.locationSetting.shadowType){
+ case 0:
+ Renderer.drawString(line, this.locationSetting.x/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
+ break;
+ case 1:
+ Renderer.drawStringWithShadow(line, this.locationSetting.x/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
+ break;
+ case 2:
+ Renderer.drawString(blackText[i], (this.locationSetting.x+1)/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
+ Renderer.drawString(blackText[i], (this.locationSetting.x-1)/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
+ Renderer.drawString(blackText[i], this.locationSetting.x/this.locationSetting.scale, (this.locationSetting.y+1)/this.locationSetting.scale +9*i)
+ Renderer.drawString(blackText[i], this.locationSetting.x/this.locationSetting.scale, (this.locationSetting.y-1)/this.locationSetting.scale +9*i)
- text.forEach((line, i)=>{
- Renderer.scale(this.locationSetting.scale, this.locationSetting.scale)
- switch(this.locationSetting.shadowType){
- case 0:
- Renderer.drawString(line, this.locationSetting.x/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
- break;
- case 1:
- Renderer.drawStringWithShadow(line, this.locationSetting.x/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
- break;
- case 2:
- Renderer.drawString(blackText[i], (this.locationSetting.x+1)/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
- Renderer.drawString(blackText[i], (this.locationSetting.x-1)/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
- Renderer.drawString(blackText[i], this.locationSetting.x/this.locationSetting.scale, (this.locationSetting.y+1)/this.locationSetting.scale +9*i)
- Renderer.drawString(blackText[i], this.locationSetting.x/this.locationSetting.scale, (this.locationSetting.y-1)/this.locationSetting.scale +9*i)
-
- Renderer.drawString(line, this.locationSetting.x/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
- break;
- }
- })
- Renderer.scale(1, 1)
+ Renderer.drawString(line, this.locationSetting.x/this.locationSetting.scale, this.locationSetting.y/this.locationSetting.scale +9*i)
+ break;
+ }
+ })
+ Renderer.scale(1, 1)
+ }catch(e){ //incase of wrong opengl context
+ }
}
}