Need help putting these Command Options in the center of the brain image.

FelixSitu

Villager
Member
Joined
Mar 31, 2018
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
I was working on creating my own custom menu that displays two characters as well as the menu command list inside a brain image to give a sense of "accessing info through the brain." This menu is almost complete, however, the options are not centered around my image, which I tried to work on in JavaScript.

Moving those command lists (Memories, Option, and Rewind) to the center of the image is all I ask for. What part of the script do I need to edit?

Thank you.
 

Attachments

  • Screenshot (40).png
    Screenshot (40).png
    1.6 MB · Views: 23

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,695
Reaction score
12,244
First Language
English
Primarily Uses
RMMZ
[move]JS Plugin Requests[/move]
 

FelixSitu

Villager
Member
Joined
Mar 31, 2018
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
Sorry about that, thank you.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,159
First Language
English
Primarily Uses
RMMV
Can you share the code which you have written so far? It will be necessary to pinpoint where to edit it.
Please use the CODE tags with good formatting - only the window with "Memory" "Options" "Rewind" is needed.
Code:
//example code
 

FelixSitu

Villager
Member
Joined
Mar 31, 2018
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
The main coding I have been working on was my own custom plugin that changes the menu called "Alt Menu."

/*
* ALT MENU
*/

(function(){


Scene_MenuBase.prototype.createBackground = function() {
this._backgroundSprite = new Sprite();
this._backgroundSprite.bitmap = ImageManager.loadPicture("blue_brain");
this.addChild(this._backgroundSprite);
this._backgroundSprite.y = Graphics.boxHeight/3.8;
};


var _Scene_Menu_create = Scene_Menu.prototype.create;

Scene_Menu.prototype.create = function() {

_Scene_Menu_create.call(this);
//Scene_MenuBase.prototype.create.call(this);
//this.createCommandWindow();
//this.createGoldWindow();
//this.createStatusWindow();

/*
this._commandWindow;
this._goldWindow;
this._statusWindow;
*/

this._statusWindow.x = 0;
this._statusWindow.y = 0;


this._commandWindow.y = this._statusWindow.height;
this._commandWindow.x = 0;
//this._commandWindow.x = this._statusWindow.width/2;

//this._goldWindow.x = this._statusWindow.width/2;
//this._goldWindow.y = this._commandWindow.height/2;

};

Window_MenuStatus.prototype.windowWidth = function() {
return Graphics.boxWidth;
};

Window_MenuStatus.prototype.windowHeight = function() {
return Graphics.boxHeight/3.5;
};
Window_MenuStatus.prototype.numVisibleRows = function() {
return 1;
};
Window_MenuStatus.prototype.maxCols = function() {
return 2;
};
Window_MenuCommand.prototype.windowWidth = function() {
//return 200;
return Graphics.boxWidth;
};
Window_MenuCommand.prototype.windowHeight = function() {
//return this.fittingHeight(this.numVisibleRows());
return Graphics.boxHeight/1.394;
//return Graphics.boxHeight/5.5;
};
Window_MenuCommand.prototype.numVisibleRows = function() {
return this.maxItems();
};
Window_MenuCommand.prototype.maxCols = function() {
return 1;
};


})();

The "memories" and "rewind" are renamed "items" and "Game end" respectively.

Thank you.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,159
First Language
English
Primarily Uses
RMMV
I read through the rpg_windows.js file and the solution actually seems to be simple.

Try putting this into your code:
Code:
Window_MenuCommand.prototype.itemTextAlign = function() {
   return 'center';
};
 

FelixSitu

Villager
Member
Joined
Mar 31, 2018
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
Thank you, however the text moved to the horizontal center only. However, the y-coordinates of the text are still close to 0, at the top of the image. Is there a way to move to the vertical center as well?
 

Latest Threads

Latest Profile Posts

The main game of my trilogy/saga 50%OFF on Steam..... its now or never more
I swap between Ace and MZ so I can stay fresh but - what do you mean you can use subfolders in the plugin's folder for easier organization!?
Did some new music again, praise be. To the next song!

Forum statistics

Threads
123,143
Messages
1,154,304
Members
161,481
Latest member
JamesBelton
Top