Lots of work. Somewhat runs through mission file now and shows backgrounds.
This commit is contained in:
parent
1e710af520
commit
3b12dcbda5
10 changed files with 505 additions and 66 deletions
63
Js/TextFunctions.js
Normal file
63
Js/TextFunctions.js
Normal file
|
@ -0,0 +1,63 @@
|
|||
'use strict';
|
||||
|
||||
class TextFunctions {
|
||||
constructor() {
|
||||
this.mainUi = undefined;
|
||||
this.title = undefined;
|
||||
this.diva = undefined;
|
||||
this.dialogBox = undefined;
|
||||
this.character = undefined;
|
||||
this.dialog = undefined;
|
||||
}
|
||||
|
||||
findTextElements() {
|
||||
this.mainUi = document.getElementById('main-ui-img');
|
||||
this.title = document.getElementById('title');
|
||||
this.diva = document.getElementById('diva');
|
||||
this.dialogBox = document.getElementById('dialog-box');
|
||||
this.character = document.getElementById('character');
|
||||
this.dialog = document.getElementById('dialog');
|
||||
}
|
||||
|
||||
titleText(show, text) {
|
||||
if(text != undefined) {
|
||||
this.title.innerHTML = text;
|
||||
}
|
||||
this.title.style = show ? "opacity: 1;" : "opacity: 0;";
|
||||
}
|
||||
|
||||
divaText(show, text) {
|
||||
if(text != undefined) {
|
||||
this.diva.innerHTML = text;
|
||||
}
|
||||
this.diva.style = show ? "opacity: 1;" : "opacity: 0;";
|
||||
}
|
||||
|
||||
characterName(show, text) {
|
||||
if(text != undefined) {
|
||||
this.character.innerHTML = text;
|
||||
}
|
||||
this.mainUi.style = show ? "opacity: 1;" : "opacity: 0;";
|
||||
this.character.style = show ? "opacity: 1;" : "opacity: 0;";
|
||||
}
|
||||
|
||||
dialog(show, text) {
|
||||
if(text != undefined) {
|
||||
this.dialog.innerHTML = text;
|
||||
}
|
||||
this.mainUi.style = show ? "opacity: 1;" : "opacity: 0;";
|
||||
this.dialogBox.style = show ? "opacity: 1;" : "opacity: 0;";
|
||||
}
|
||||
|
||||
resetAll() {
|
||||
this.title.innerHTML = '';
|
||||
this.diva.innerHTML = '';
|
||||
this.character.innerHTML = '';
|
||||
this.dialog.innerHTML = '';
|
||||
this.title.style = "opacity: 0;";
|
||||
this.diva.style = "opacity: 0;";
|
||||
this.mainUi.style = "opacity: 0;";
|
||||
this.character.style = "opacity: 0;";
|
||||
this.dialogBox.style = "opacity: 0;";
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue