设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 94|回复: 0

[制作教程] Ace's guide to the package(.json)!

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    慵懒
    3 天前
  • 签到天数: 207 天

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    21262
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    25800

    灌水之王

    发表于 前天 20:25 | 显示全部楼层 |阅读模式
    The package.json file is a manifest file. It’s like a description for nwjs to read. It provides an easy access to options that you can’t do normally, unless you do script calls towards it. This guide will provide info that is helpful to RPG Maker MV devs. Grab your favorite code editor (or Notepad) let’s edit this to our pleasure.

    The necessary stuff:
    These are the options that are necessary to get the game working within nwjs. These are already filled by MV, but it’s good to know them, since there may be a necessity to edit stuff.


    • “name”: This is thename of the program. This is used to create a Chromium profile (which will allow you to have a separate GPU Cache and storing cookies). If the value is empty, the default nwjs profile will be used. This is important to edit (especially if you store cookies or do something GPU intensive), since if you decide to use an older version of nwjs, it will throw a Profile Error. You can either have it as <Game Name> or <Developer>/<Game Name>. Examples:
                      Code:        
      “name”: “MV Game”, “name”: “KADOKAWA/MV Game”,

    • “main”: This is the location of the index.html file. This is needed so the game can start once the executable runs. The path must be based on the perspective of the package.json file. Example:
                      Code:        
      “main”: “www/index.html”

    Control Fields:
    These adjust features within nwjs.


    • “nodejs”: This boolean variable turns on or off NodeJS. Best to keep this on unless there’s a necessity.
                      Code:        
      “nodejs”: true,

    • “node-main”: Specifies a node.js script to run at startup. Use this only if you need to run a JS file at startup.
                      Code:        
      “node-main”: “www/startup.js”

    • “bg-script”: If you want to run a script in the background, specify the file here.
    • “chromium-args”: Specify what command line arguments you want to use when running the game. These provide a lot of options, so head over to this page for a breakdown. Example of how to use it:
                      Code:        
      "chromium-args": "--enable-gpu-rasterization --enable-gpu-memory-buffer-video-frames --enable-native-gpu-memory-buffers --enable-zero-copy --enable-gpu-async-worker-context"



    • “js-flags”: Add flags for the JavaScript intepretter. The default in MV is only the --expose-gc flag. See this page for all the flags.
                      Code:        
      “js-flags”: “--expsoe-gc”

    Window Settings:
    This is where you adjust the window of the game (not the game’s actual resolution). In order to make these settings, it needs to be written like this:
                    Code:        
    "window": { "title": "<Insert Title Here>", "toolbar": false, "width": 1280, "height": 720, "icon": "icon/icon.png" }

    Anything you need to add must be within the curly bracers.


    • “icon”: The icon for the game. Used when the game runs.
                      Code:        
      “icon”: “www/icon/icon.png”

    • “id”: The Window ID. This is used to remember the size and the position of the window. This must be unique.
                      Code:        
      “id”: “MV Game”,

    • “title”: The text that shows up in the title bar of the game. You can put anything there but it will show up for a bit until the game loads up.
                      Code:        
      “title”: “Game Title”,

    • “toolbar”: Deprecated since 0.13.0. It shows the stock toolbar. Pretty useless, in all honesty.
                      Code:        
      “toolbar”: false,

    • “width” and “height”: Specifies the resolution that the executable will start. Best to match these with the game’s resolution.
                      Code:        
      “width”: 1280, “height”: 720,

    • “min_width” and “min_height”: Specifies the minimum resolution of the game’s window that it can resize.
                      Code:        
      “min_width”: 720, “min_height”: 480,

    • “fullscreen”: The executable start in full-screen.
                      Code:        
      “fullscreen”: false,

    • “kiosk”: Turns on or off Kiosk mode. The game will enter in full-screen mode (and you won’t be able to exit full-screen mode unless you’ve included an option to exit kiosk mode) and the game’s window will be on top of all other windows. Handy for showcases.
                      Code:        
      “kiosk”: false,

    • “resizable”: If this is false, the window won’t resize by the user.
                      Code:        
      “resizeable”: false

    Now there are more settings that you can adjust (I wanted to cover the settings that will be the most useful) so take a look at nwjs’ documentation and see what you like. I hope you find this useful.


    本贴来自国际rpgmaker官方论坛作者:AceOfAces处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/aces-guide-to-the-package-json.104166/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-10 02:05 , Processed in 0.064099 second(s), 57 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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