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

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
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,115
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,115
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?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top