扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 170|回复: 0

[转载发布] MV Black Room (类似于VA的Black room by VIPArcher)

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    2025-3-29 03:52
  • 签到天数: 127 天

    连续签到: 11 天

    [LV.7]常住居民III

    2350

    主题

    420

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    11311
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    14109

    灌水之王

    发表于 2024-2-24 18:41:57 | 显示全部楼层 |阅读模式
    近期移植的MV屋顶遮挡:https://rpg.blue/forum.php?mod=viewthread&tid=396305

    效果:



    把下面的代码存储为black_room.js,放进js/plugins/目录,然后在插件管理器里调用。
    地图添加note:


    JAVASCRIPT 代码
    [code]"use strict"

    /*:
    * @plugindesc Black Room.
    * @author Garfeng
    *
    * @param Tile Width
    * @desc 一格的尺寸,默认48
    * @default 48
    *
    * @param Padding
    * @desc 内边距(0为全部填满颜色,我自用设为24)
    * @default 0
    *
    * @param Fade Speed
    * @desc 渐变速度
    * @default 10
    *
    * @param Black Room Color
    * @desc 遮盖层的颜色,比如 rgba(255,0,0,1) 代表红色
    * @default rgba(0,0,0,1)
    *
    * @param Black Room Z
    * @desc 遮盖层的z坐标
    * @default 9999
    */

    /* 使用方法:
    * 地图添加注释,内部必须为数组的json格式
    * [
    * [A_x1,A_y1,A_x2,A_y2],
    * [B_x1,B_y1,B_x2,B_Y2]
    * ]
    *
    * x1,y1 为左上角角点的坐标,x2,y2位右下角角点坐标
    * 比如:我设置了三个区:
    *
    * [
    *     [9,3,14,10],
    *     [14,3,16,11],
    *     [16,3,21,10]
    * ]

    */


    var Black_Room_RE = /([.\s\S]+)/i;

    var parameters = PluginManager.parameters("black_room");

    var FKCC = parseInt(parameters["Tile Width"]);
    var BLACK_ROOM_PADDING = parseInt(parameters["Padding"]);
    var BLACK_ROOM_FADE_SPEED = parseInt(parameters["Fade Speed"]);
    var Black_Room_Color = parameters["Black Room Color"];
    var Black_Room_Z = parseInt(parameters["Black Room Z"]);

    var Garfeng_Spriteset_Map_initialize = Spriteset_Map.prototype.initialize;
    Spriteset_Map.prototype.initialize = function(){
            Garfeng_Spriteset_Map_initialize.call(this);

            this.black_rooms = new Array();
            this.black_rooms_sprite = new Array();

            let str = $dataMap.note;
            let match = Black_Room_RE.exec(str);

            if(match != null){
                try{
                this.black_rooms = JSON.parse(match[1]);
            }catch(e){
                console.error(e);
                console.log(match[1]);
            }
            if(this.black_rooms != null){
                    this.setupBlackRoom();
            }
            }

    }

    var Garfeng_Spriteset_Map_createLowerLayer = Spriteset_Map.prototype.createLowerLayer;

    Spriteset_Map.prototype.createLowerLayer = function(){
            Garfeng_Spriteset_Map_createLowerLayer.call(this);
    };



    Spriteset_Map.prototype.checkPosIn = function(sp){
            let x = $gamePlayer._realX;
        let y = $gamePlayer._realY;

            if(x >= sp["x"] && x = sp["y"] && y
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2025-4-20 19:54 , Processed in 0.086268 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表