change choice box position

Discussion in 'RPG Maker MV' started by pasunna, Apr 26, 2019.

  1. pasunna

    pasunna Veteran Veteran

    Messages:
    113
    Likes Received:
    17
    First Language:
    thai
    Primarily Uses:
    RMMV
    Hi
    I use yanfly engine core to set message window position and size
    (because I use 16:9 and if the box too long player will lost focus in text)
    but the choice is not move to align with the message box
    how to change that or I need to change the main rmmv code?
    thank you


    Capture.JPG
     
    #1
  2. Eliaquim

    Eliaquim Raze: The Rakuen Zero's Guardian! Veteran

    Messages:
    672
    Likes Received:
    234
    Location:
    Brazil - Rio de Janeiro
    First Language:
    Portuguese - Br
    Primarily Uses:
    RMMV
    Here is the part of the code that you need to change:
    Code:
    Window_ChoiceList.prototype.updatePlacement = function() {
        var positionType = $gameMessage.choicePositionType();
        var messageY = this._messageWindow.y;
        this.width = this.windowWidth();
        this.height = this.windowHeight();
        switch (positionType) {
        case 0:
            this.x = 0;
            break;
        case 1:
            this.x = (Graphics.boxWidth - this.width) / 2;
            break;
        case 2:
            this.x = Graphics.boxWidth - this.width;
            break;
        }
        if (messageY >= Graphics.boxHeight / 2) {
            this.y = messageY - this.height;
        } else {
            this.y = messageY + this._messageWindow.height;
        }
    };
    Here is what you need to change
    case 2(Right position):
    this.x = Graphics.boxWidth - this.width;
     
    #2
    caethyril and pasunna like this.
  3. pasunna

    pasunna Veteran Veteran

    Messages:
    113
    Likes Received:
    17
    First Language:
    thai
    Primarily Uses:
    RMMV
    thank you
    it working perfect now!
    Capture.JPG
     
    #3
    Eliaquim likes this.

Share This Page