- Joined
- Aug 22, 2019
- Messages
- 16
- Reaction score
- 2
- First Language
- Russian
- Primarily Uses
- RMMV
Good day!
I was trying to create simple plugin for testing purposes: window in Scene_menu which will show picture based on a variable value. If it's 1, picture '123' will be shown. If it's 2, picture '1234', if it's 3, picture '12345', if none of the above, picture '12'.
Here is the part of the code in question (everything else is just stuff to create window itself).
Window just don't appear. Changing variable value changes nothing.
Just in case, I've tested plugin with 'drawText' instead of 'drawPicture'. It works perfectly.
I'm a little lost here. Can you explain, what am I doing wrong?
I was trying to create simple plugin for testing purposes: window in Scene_menu which will show picture based on a variable value. If it's 1, picture '123' will be shown. If it's 2, picture '1234', if it's 3, picture '12345', if none of the above, picture '12'.
Here is the part of the code in question (everything else is just stuff to create window itself).
Window_Test.prototype.drawPicture = function(filename, x, y) {
var bitmap = ImageManager.loadPicture(filename);
this.contents.blt(bitmap, 0, 0, bitmap._canvas.width, bitmap._canvas.height, x, y);
};
Window_Test.prototype.refresh = function() {
if ($gameVariables.value(0001) === 1) {
this.drawPicture ("123", 0, 0, 200, 200);
} else if ($gameVariables.value(0001) === 2) {
this.drawPicture ("1234", 0, 0, 200, 200);
} else if ($gameVariables.value(0001) === 3) {
this.drawPicture ("12345", 0, 0, 200, 200);
} else {
this.drawPicture ("12", 0, 0, 200, 200);
}
};
Window just don't appear. Changing variable value changes nothing.
Just in case, I've tested plugin with 'drawText' instead of 'drawPicture'. It works perfectly.
I'm a little lost here. Can you explain, what am I doing wrong?
Last edited: