Plugin to move a right justified Choice Box a specified number of pixels to left?

Discussion in 'JS Plugin Requests' started by ACECORP, Feb 19, 2018.

  1. ACECORP

    ACECORP Founder & Entrepreneur Veteran

    Messages:
    253
    Likes Received:
    38
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    In RMMV, there is a choices box component that folks often use for Yes/No and other choices as shown below.

    [​IMG]

    The default placement options for this box are left, middle, and right as shown in the RMMV IDE

    [​IMG]

    Does anyone have a plugin or has plugin code that can move the box a specified number of pixels to the left or right that is fully compatible with the Yanfly Plugin Suite?

    For example, I have my boxes set "right" but I need to move them 400 px to the left so they are not in the middle but they are not on the far right either
     
    Last edited: Feb 19, 2018
    #1
  2. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,562
    Likes Received:
    978
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    This isn't a full plugin but here's a start on what you would need to do:
    PHP:
    (function() {
        var 
    alias_Window_ChoiceList_start Window_ChoiceList.prototype.start;
        
    Window_ChoiceList.prototype.start = function() {
            
    alias_Window_ChoiceList_start.call(this);
            switch (
    $gameMessage.choicePositionType()) {
            case 
    0//left
                
    this.+= 0;
                break;
            case 
    1//middle
                
    this.+= 0;
                break;
            case 
    2//right
                
    this.-= 400;
                break;
            }
        }
    })();
     
    #2
  3. ACECORP

    ACECORP Founder & Entrepreneur Veteran

    Messages:
    253
    Likes Received:
    38
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Awesome! That worked. Thanks so much!
     
    #3

Share This Page