Hi guys new here im just trying to learn java script i search a little bit in the net and some tutorial in youtube and then i tried to make a simple plugin where when you talk to npc it will show a window and it will display some text
but i have two problem and I'm stuck with it
first it don't show the text that i want
and second i can't go back to the map(or close the window after i talk to the npc)
here's the code that i made so far sorry for messy code im completely newbie thank you for understanding and helping
me out
EDIT: closing window i use input
update() {
if (Input.isTriggered("cancel")) SceneManager.pop(); //close the custom scene
}
but i have two problem and I'm stuck with it
first it don't show the text that i want
and second i can't go back to the map(or close the window after i talk to the npc)
here's the code that i made so far sorry for messy code im completely newbie thank you for understanding and helping
me out
JavaScript:
/** /*:
* @target MZ
*
* @author name
* @plugindesc hehhey
*
* @command open
* @text Open Window
*/
;
(() => {
PluginManager.registerCommand('mysceneHEYHEY', 'open', args => {
SceneManager.push(MyScene);
});
class MySampleWindow extends Window_Base {
constructor(rect) {
super(rect);
}
refresh() {
this.contents.clear();
this.drawTextEx('super text', 0,0); //I tried to draw text
}
}
class MyScene extends Scene_Base {
constructor(rect) {
super(rect);
this.goldwinp = new MySampleWindow(new Rectangle(0, 0, 240, 416));
this.addChild(this.goldwinp);
}
refresh() {
this.contents.clear();
}
}
}) ();
EDIT: closing window i use input
update() {
if (Input.isTriggered("cancel")) SceneManager.pop(); //close the custom scene
}