Message Arrow outside of the frame

Discussion in 'JS Plugin Requests' started by miani, Mar 19, 2019.

  1. miani

    miani Veteran Veteran

    Messages:
    77
    Likes Received:
    61
    First Language:
    Portuguese
    I want that the window skin arrow in the messages is displayed outside of the message box, like 10px down.

    I made a screen to show it better. I use Galv Message Styles plugin.

    Untitled-1.jpg

    I would appreciate if anyone could help me with that.
     
    #1
  2. Magnus0808

    Magnus0808 Software Developer Veteran

    Messages:
    116
    Likes Received:
    109
    First Language:
    Danish
    Primarily Uses:
    RMMV
    Made this for you. Just change the plugin parameters to change the location of the arrow. 10 pixels down would probably be something like: y anchor -0.3.

    I also added a plugin parameter so you can change the location of the arrow during the game if you want to.
    If you have any problems with the plugin feel free to message me. :)

    Code:
    //=============================================================================
    // Arrow Location
    // MRP_GALV_MessageStyles_ArrowLocation.js
    // By Magnus0808 || Magnus Rubin Peterson
    //=============================================================================
    
    /*:
     * @plugindesc Allows the option to change the anchors for the arrow.
     * @author Magnus0808
     *
     * @help Set the x and y anchors in the plugin parameters. You can also use the
     * plugin command:
     *         ArrowAnchor x y
     * set x and y to be the new anchors. If left untouched then the current value
     * will be used.
     *
     * E.g 'ArrowAnchor 0.5 -0.2' or 'ArrowAnchor x -0.2'
     *
     * @param x anchor
     * @desc The x anchor of the arrow. Measured in blocks. Default: 0.5
     * @default 0.5
     *
     * @param y anchor
     * @desc The y anchor of the arrow. Measured in blocks. Default: 0
     * @default 0
     
     */
    (function(){
        MRP_ArrowLocation = {};
        MRP_ArrowLocation.Parameters = PluginManager.parameters('MRP_GALV_MessageStyles_ArrowLocation');
        MRP_ArrowLocation.xAnchor = Number(MRP_ArrowLocation.Parameters['x anchor']);
        MRP_ArrowLocation.yAnchor = Number(MRP_ArrowLocation.Parameters['y anchor']);
        
        var MRP_GALVMSAL_GI_PLUGINCOMMAND_OLD = Game_Interpreter.prototype.pluginCommand;
        Game_Interpreter.prototype.pluginCommand = function(command, args) {
            MRP_GALVMSAL_GI_PLUGINCOMMAND_OLD.call(this, command, args)
            
            if (command === 'ArrowAnchor'){       
                MRP_ArrowLocation.xAnchor = args[0].toLowerCase() != "x" ? Number(args[0]) : MRP_ArrowLocation.xAnchor;
                MRP_ArrowLocation.yAnchor = args[1].toLowerCase() != "y" ? Number(args[1]) : MRP_ArrowLocation.yAnchor;
                Galv.Mstyle.refreshMessageWindows();       
            }
        };
        
        var MRP_GALVMSAL_WM_CREATEWINDOWTAIL_OLD = Window_Message.prototype.createWindowTail;
        Window_Message.prototype.createWindowTail = function() {
            MRP_GALVMSAL_WM_CREATEWINDOWTAIL_OLD.call(this);
            this._tailSprite.anchor.x = MRP_ArrowLocation.xAnchor;
            this._tailSprite.anchor.y = MRP_ArrowLocation.yAnchor;   
        };
        
    })();
     

    Attached Files:

    #2
    miani likes this.
  3. miani

    miani Veteran Veteran

    Messages:
    77
    Likes Received:
    61
    First Language:
    Portuguese
    Hi thanks for the quick reply. Actually I was using the windowskin arrow, the standard from MV, and not the one from the Galv's plugin.

    But I made it in another way with your script, it's looking very good now, thanks for your time. I'll put your name in the credits for sure.

    Final result:
     
    #3
    Magnus0808 likes this.

Share This Page