I'm writing a plugin to replace the default menu for my game and have run into an issue.
Right now I'm declaring the image elements of my menu with variables and calling them as children, which works. But I can't figure out how to reposition the images to where I want them.
Also, how would I layer images on top of other images have them display correctly?
<original code was here, removed as it was incorrect.>
Update: I managed to figure out the issue. Here's a new snippet of code:
I did this for every element of my menu and hardcoded in the positions. I'm still a newbie so I won't try to explain everything, but I hope this is fairly clear.
To be clear, this provides no functionality. I'm working on that part next.
Right now I'm declaring the image elements of my menu with variables and calling them as children, which works. But I can't figure out how to reposition the images to where I want them.
Also, how would I layer images on top of other images have them display correctly?
<original code was here, removed as it was incorrect.>
Update: I managed to figure out the issue. Here's a new snippet of code:
var menubg = new Sprite (ImageManager.loadPicture("MenuBG_WithINFO"))
Scene_Menu.prototype = Object.create(Scene_Base.prototype);
Scene_Menu.prototype.constructor = Scene_Menu;
Scene_Menu.prototype.initialize = function() {
Scene_Base.prototype.initialize.call(this);
this.addChild(menubg);
this.createSideBar();
this.createYourNewImageFunctionHere();
//This function makes the menu sidebar show up.
Scene_Menu.prototype.createSideBar = function() {
this._side = new Sprite(ImageManager.loadPicture("Menu_SidebarCommands"));
this._side.x = 75;
this._side.y = 75;
this.addChild(this._side);
};
//Here is our new function to make the next menu element show up.
Scene_Menu.prototype.createYourNewImageFunctionHere= function() {
this._newElement= new Sprite(ImageManager.loadPicture("YourMenuImageNameHere"));
this._newElement.x = 75;
this._newElement.y = 75;
this.addChild(this._side);
};
I did this for every element of my menu and hardcoded in the positions. I'm still a newbie so I won't try to explain everything, but I hope this is fairly clear.
To be clear, this provides no functionality. I'm working on that part next.