RPG Maker Forums

[Solved] Thanks for the pointers, Dreadshadow!


Hi there! I don't usually ask questions, but then again I don't usually work with too much with graphics, so...


I'm trying to figure out how to show Sprite images below windows in a scene.


Attached are the image and plugin file. Place the image in img/pictures/, and call the demo scene with


SceneManager.push(Scene_Demo);


... but I'm sure you already knew that.


Scroll down some more for the code.


Thanks in advance for your help!


Screenshot_1.png


function Scene_Demo() {
this.initialize.apply(this, arguments);
}

Scene_Demo.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Demo.prototype.constructor = Scene_Demo;

Scene_Demo.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
}

Scene_Demo.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);

this.createCommandWindow();

var img = ImageManager.loadBitmap("img/pictures/", "annoyance");
this._image = new Sprite(img);
this._image.x = 400;
this._image.y = 300;
this.addChild(this._image);
}

Scene_Demo.prototype.createCommandWindow = function() {
this._choiceWindow = new Window_ChooseOne(0, 0);
this._choiceWindow.x = (Graphics.width - this._choiceWindow.width) / 2;
this._choiceWindow.y = (Graphics.height - this._choiceWindow.height) / 2;
this._choiceWindow.setHandler('yes', this.yesCommand.bind(this));
this._choiceWindow.setHandler('no', this.cancelCommand.bind(this));
this._choiceWindow.setHandler('cancel', this.cancelCommand.bind(this));
this.addWindow(this._choiceWindow);
}

Scene_Demo.prototype.yesCommand = function () {}

Scene_Demo.prototype.cancelCommand = function () {
this.popScene();
}


function Window_ChooseOne() {
this.initialize.apply(this, arguments);
}

Window_ChooseOne.prototype = Object.create(Window_Command.prototype);
Window_ChooseOne.prototype.constructor = Window_ChooseOne;

Window_ChooseOne.prototype.makeCommandList = function () {
this.addCommand("yes", 'yes');
this.addCommand("no", 'no');
};




Attachments


View attachment Demo.js


annoyance.png

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,470
Members
137,821
Latest member
Capterson
Top