hi guys leaning javascript here from the scratch
Soo what I'm doing I created a window that will show in scenemap with
a picture on it and if I click it i can open like item window or equipment window something like
that but i can't find the area i tried to put it on x = 0 and y = 0 so the area that im suppose to touch
is in upper left corner i use console.log to find the area and I click all the area in the map but the event
won't trigger I actually don't know what to do this probably very advance to me right now, I don't know
can you help me out to understand this code a little?
if (TouchInput.isTriggered && TouchInput.x == 0, TouchInput.y == 0) {
console.log ("yes");
}
here's the code that Im doing right now?
thank you guys and have a nice day
Soo what I'm doing I created a window that will show in scenemap with
a picture on it and if I click it i can open like item window or equipment window something like
that but i can't find the area i tried to put it on x = 0 and y = 0 so the area that im suppose to touch
is in upper left corner i use console.log to find the area and I click all the area in the map but the event
won't trigger I actually don't know what to do this probably very advance to me right now, I don't know
can you help me out to understand this code a little?
if (TouchInput.isTriggered && TouchInput.x == 0, TouchInput.y == 0) {
console.log ("yes");
}
here's the code that Im doing right now?
JavaScript:
class showimgface extends Window_Base {
constructor(rect) {
super(rect);
this.opacity = 0;
}
update() {
super.update();
this.sifupdate();
}
async sifupdate() {
return new Promise((s,f) => {
try {
this.contents.clear();
this.drawPicture("inventory", 0, 0);
} catch (e) {
f(e);
}
}).then().catch(e=>{
throw e;
});
}
}
Window_Base.prototype.drawPicture = function(pictureName, x, y) {
var bitmap = ImageManager.loadPicture(pictureName);
var pw = bitmap.width;
var ph = bitmap.height;
var sx = 0;
var sy = 0;
this.contents.blt(bitmap, sx, sy, pw, ph, x, y);
};
const sms = Scene_Map.prototype.start;
Scene_Map.prototype.start = function() {
sms.call(this);
this.sifwindow = new showimgface(new Rectangle(0, 0, 500, 624))
this.addChild(this.sifwindow);
if (TouchInput.isTriggered && TouchInput.x == 0, TouchInput.y == 0) {
console.log ("yes");
}
}
thank you guys and have a nice day