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,580
Reaction score
12,123
First Language
English
Primarily Uses
RMVXA
[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,157
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,157
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 Posts

Latest Profile Posts

If a person becomes voluntarily missing, does it cause the butterfly effect?
normal_water_is_fine.jpg

Just going to use stationary water for the randomized maps. Sure, particles would look cool... But this is about compromising and not spending countless hours making the perfect water particle for each set piece with water. :kaoswt:
Maybe I should get rid of the Banish ability in my game. It's a non-elemental spell that doesn't even appear in the magic chart. It's only there because my Elementalist doesn't use light or dark magic. It only effects summoned creatures.
ScreenShot_5_18_2022_0_37_0.png
I've been redoing all of the major areas in my game. starting with a place called Century Park. thankfully because all of the locations are distorted memories, I can make these places pretty abstract.

Forum statistics

Threads
121,911
Messages
1,145,111
Members
160,173
Latest member
Tinseltownie
Top