Status
Not open for further replies.

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
358
Reaction score
51
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
280
Reaction score
309
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
358
Reaction score
51
First Language
Spanish
Primarily Uses
RMMV
It works, thanks :)
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,719
Reaction score
5,759
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

Sometimes a mechanic that is meant to add challenge is just annoying. Even the Final Fantasy games did not completely escape this pitfall of design. (FF8 draw system I'm looking at you - grrrr)
starting working on the sprites for one of my games major antagonists finally. here's the first frame of his chanting motion in battle.
Have spent too much time hammering out with a friend just how to make a reoccurring enemy that permanently learns skills you use against her.
I know what I want in a loose sense. Maybe I should just make a post asking for opinions and suggestions.
Shoot Enemy Off-Screen, Run RPG Maker Game as a Web Server, & Thai Keyboard | RPG Maker News #109

Forum statistics

Threads
113,734
Messages
1,077,037
Members
147,762
Latest member
Bad_At_Scripting
Top