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
23,578
Reaction score
13,354
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,188
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,188
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

bandicam 2023-05-29 22-28-54-159.png
When will I be able to play my own game? There is a lot of work, but I am working hard towards the goal
Add Monser2.png!!
index.php

Happy Memorial Day to those on here like me who live in the United States. :)
Alright got a video of a review of a fake PS5 here. I've decided I'm only going to do maybe 10 videos about bootleg consoles, and then I think I'm going to move on, and post YouTube videos of old video game TV advertisements for franchises like Mario and Sonic and Spyro and all that for a little nostalgia. :cool:

Two solid days and I still have four slots left in my custom A2 tilesheet I am drawing.

Forum statistics

Threads
131,527
Messages
1,220,539
Members
173,221
Latest member
ZecaVn
Top