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,713
Reaction score
12,261
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

So unbelievably excited for IGMC this year! First public game was for the original one and I'm just so pumped!!
Sometimes I am amazed at how relentless spam bots are. I would clear the que and then see 800~5k more depending on their mood.
Work on UD is already so delayed but I gotta drop everything so that I have something ready for IGMC!
Messed up the chains... :kaoback:
Sw7U8dA.jpg

Character: Jeanne D'Arc from Fate/Apocrypha.
Neptrone wrote on Andar's profile.
Hello Andar, i just saw you created a lot of helpful thread in the past regarding RPG, genre, game design, etc, etc.

Do you have full collection or list about every useful thread that you made in the past ? I think it would be very useful for me.


Thanks :)

Forum statistics

Threads
123,255
Messages
1,155,241
Members
161,636
Latest member
qixxi
Top