Status
Not open for further replies.

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
403
Reaction score
66
First Language
Spanish
Primarily Uses
RMMV
Here'she code for changing window's heigth:

Code:
Window_Base.prototype.lineHeight = function() {
    if ($gameSwitches.value(19, true)) {
        return 26;
    } else {
        return 36;
    }
};
Seems simple enough, but it doesn't work for the width, so "Window_Base.prototype.lineWidth" won't do anything for me. Any solution?
 

SeaPhoenix

Veteran
Veteran
Joined
May 14, 2015
Messages
295
Reaction score
341
First Language
English
Primarily Uses
RMMV
Looks like you're using MV? The choice window's width is determined by the "widest" choice, bounded by a minimum width (96 in the second function below) and a maximum (Graphics.boxWidth, i.e., the width of the game window). The code can be found in rpg_windows.js (assuming you're not using any plugins that affect the choicelist window):

Code:
Window_ChoiceList.prototype.windowWidth = function() {
    var width = this.maxChoiceWidth() + this.padding * 2;
    return Math.min(width, Graphics.boxWidth);
};

Window_ChoiceList.prototype.maxChoiceWidth = function() {
    var maxWidth = 96;
    var choices = $gameMessage.choices();
    for (var i = 0; i < choices.length; i++) {
        var choiceWidth = this.textWidthEx(choices[i]) + this.textPadding() * 2;
        if (maxWidth < choiceWidth) {
            maxWidth = choiceWidth;
        }
    }
    return maxWidth;
};
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
403
Reaction score
66
First Language
Spanish
Primarily Uses
RMMV
It works, thanks :)
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,919
Reaction score
5,847
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Working in the IT industry:
- "How long does it take?".
- "It takes 1 month".
- "What if we add more people to the project?".
- "It would take 2 months".
Doing RPG Maker News for 16th September 2021

Stream is live! I am currently doing pixel art and will be practicing shading! Feel free to drop by!
wow, Surface Tension is really one MF of an FPS level huh
So, I got let go from my current job because my skill set didn't align with the department's goals anymore. I have some hope, because I am currently in contact with a manager from a different department, and they are desperate for more employees. We'll see what happens... :kaoswt:

Forum statistics

Threads
115,121
Messages
1,087,377
Members
149,607
Latest member
iamicon
Top