设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3377|回复: 7
打印 上一主题 下一主题

[已经解决] 有什么办法可以很快速的实现全屏

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1001
在线时间
212 小时
注册时间
2011-11-23
帖子
109
跳转到指定楼层
1
发表于 2016-6-28 22:16:44 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
就是和老版本那样,默认全屏后再开始加载和游戏相关的代码,不用在按下F4键
插件或者直接修改相关代码都是可以的,顺便再问一下MV最大支持多少分辨率?该如何修改游戏分辨率呢

Lv3.寻梦者

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
帖子
1516
2
发表于 2016-6-30 09:19:28 | 只看该作者
Graphics._switchFullScreen()

分辨率似乎没有限制,
这里改
SceneManager._screenWidth       = 816;
SceneManager._screenHeight      = 624;
SceneManager._boxWidth          = 816;
SceneManager._boxHeight         = 624;
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
22204
在线时间
8586 小时
注册时间
2011-12-31
帖子
3363
3
发表于 2016-6-30 09:47:47 | 只看该作者
  1. //=============================================================================
  2. // StartUpFullScreen.js
  3. // ----------------------------------------------------------------------------
  4. // Copyright (c) 2015 Triacontane
  5. // This software is released under the MIT License.
  6. // http://opensource.org/licenses/mit-license.php
  7. // ----------------------------------------------------------------------------
  8. // Version
  9. // 1.0.0 2016/03/06 初版
  10. // ----------------------------------------------------------------------------
  11. // [Blog]   : http://triacontane.blogspot.jp/
  12. // [Twitter]: https://twitter.com/triacontane/
  13. // [GitHub] : https://github.com/triacontane/
  14. //=============================================================================

  15. /*:
  16. * @plugindesc Start up full screen
  17. * @author triacontane
  18. *
  19. * @param Shutdown
  20. * @desc Command name for shutdown.
  21. * @default Shutdown
  22. *
  23. * @param StartUpFullScreen
  24. * @desc Command name for full screen option.
  25. * @default Full Screen
  26. *
  27. * @help Add option start up full screen.
  28. * This plugin is using only local execute.
  29. *
  30. * This plugin is released under the MIT License.
  31. */
  32. /*:ja
  33. * @plugindesc フルスクリーンで起動プラグイン
  34. * @author トリアコンタン
  35. *
  36. * @param シャットダウン
  37. * @desc タイトル画面に追加するシャットダウンの項目名です。
  38. * ローカル環境での実行時のみ表示されます。
  39. * @default シャットダウン
  40. *
  41. * @param フルスクリーンで起動
  42. * @desc オプション画面に追加する全画面で起動の項目名です。
  43. * ローカル環境での実行時のみ表示されます。
  44. * @default フルスクリーンで起動
  45. *
  46. * @help オプション画面に「フルスクリーンで起動」を追加します。
  47. * 有効な場合、ゲームをフルスクリーンで起動します。
  48. * またタイトル画面にシャットダウンを追加します。
  49. *
  50. * このプラグインはローカル環境で実行した場合のみ有効です。
  51. *
  52. * このプラグインにはプラグインコマンドはありません。
  53. *
  54. * 利用規約:
  55. *  作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
  56. *  についても制限はありません。
  57. *  このプラグインはもうあなたのものです。
  58. */

  59. function Scene_Terminate() {
  60.     this.initialize.apply(this, arguments);
  61. }

  62. (function () {
  63.     'use strict';
  64.     // Nw.js環境下以外では一切の機能を無効
  65.     if (!Utils.isNwjs()) {
  66.         return;
  67.     }

  68.     var pluginName = 'StartUpFullScreen';

  69.     var getParamString = function(paramNames) {
  70.         var value = getParamOther(paramNames);
  71.         return value == null ? '' : value;
  72.     };

  73.     var getParamOther = function(paramNames) {
  74.         if (!Array.isArray(paramNames)) paramNames = [paramNames];
  75.         for (var i = 0; i < paramNames.length; i++) {
  76.             var name = PluginManager.parameters(pluginName)[paramNames[i]];
  77.             if (name) return name;
  78.         }
  79.         return null;
  80.     };

  81.     var paramShutdown          = getParamString(['Shutdown', 'シャットダウン']);
  82.     var paramStartUpFullScreen = getParamString(['StartUpFullScreen', 'フルスクリーンで起動']);

  83.     //=============================================================================
  84.     // Graphics
  85.     //  privateメソッド「_requestFullScreen」を呼び出します。
  86.     //=============================================================================
  87.     Graphics.requestFullScreen = function() {
  88.         if (this._isFullScreen()) {
  89.             this._requestFullScreen();
  90.         }
  91.     };

  92.     //=============================================================================
  93.     // Scene_Boot
  94.     //  フルスクリーンで起動する処理を追加します。
  95.     //=============================================================================
  96.     var _Scene_Boot_start = Scene_Boot.prototype.start;
  97.     Scene_Boot.prototype.start = function() {
  98.         _Scene_Boot_start.apply(this, arguments);
  99.         if (ConfigManager.startUpFullScreen) Graphics.requestFullScreen();
  100.     };

  101.     //=============================================================================
  102.     // Scene_Title
  103.     //  シャットダウンの処理を追加定義します。
  104.     //=============================================================================
  105.     var _Scene_Title_createCommandWindow = Scene_Title.prototype.createCommandWindow;
  106.     Scene_Title.prototype.createCommandWindow = function() {
  107.         _Scene_Title_createCommandWindow.apply(this, arguments);
  108.         if (paramShutdown) this._commandWindow.setHandler('shutdown',  this.commandShutdown.bind(this));
  109.     };

  110.     Scene_Title.prototype.commandShutdown = function() {
  111.         this._commandWindow.close();
  112.         this.fadeOutAll();
  113.         SceneManager.goto(Scene_Terminate);
  114.     };

  115.     //=============================================================================
  116.     // Window_TitleCommand
  117.     //  シャットダウンの選択肢を追加定義します。
  118.     //=============================================================================
  119.     var _Window_TitleCommand_makeCommandList = Window_TitleCommand.prototype.makeCommandList;
  120.     Window_TitleCommand.prototype.makeCommandList = function() {
  121.         _Window_TitleCommand_makeCommandList.apply(this, arguments);
  122.         if (paramShutdown) this.addCommand(paramShutdown, 'shutdown');
  123.     };

  124.     var _Window_TitleCommand_updatePlacement = Window_TitleCommand.prototype.updatePlacement;
  125.     Window_TitleCommand.prototype.updatePlacement = function() {
  126.         _Window_TitleCommand_updatePlacement.apply(this, arguments);
  127.         if (paramShutdown) this.y += this.height / 8;
  128.     };

  129.     //=============================================================================
  130.     // ConfigManager
  131.     //  オプションに「フルスクリーンで起動」項目を追加します。
  132.     //=============================================================================
  133.     ConfigManager.startUpFullScreen = false;

  134.     var _ConfigManager_applyData = ConfigManager.applyData;
  135.     ConfigManager.applyData = function(config) {
  136.         _ConfigManager_applyData.apply(this, arguments);
  137.         this.startUpFullScreen = this.readFlag(config, 'startUpFullScreen');
  138.     };

  139.     var _ConfigManager_makeData = ConfigManager.makeData;
  140.     ConfigManager.makeData = function() {
  141.         var config = _ConfigManager_makeData.apply(this, arguments);
  142.         config.startUpFullScreen = this.startUpFullScreen;
  143.         return config;
  144.     };

  145.     //=============================================================================
  146.     // Window_Options
  147.     //  オプションに「フルスクリーンで起動」項目を追加します。
  148.     //=============================================================================
  149.     var _Window_Options_addGeneralOptions = Window_Options.prototype.addGeneralOptions;
  150.     Window_Options.prototype.addGeneralOptions = function() {
  151.         _Window_Options_addGeneralOptions.apply(this, arguments);
  152.         this.addCommand(paramStartUpFullScreen, 'startUpFullScreen');
  153.     };

  154.     //=============================================================================
  155.     // Scene_Terminate
  156.     //  ゲームを終了します。
  157.     //=============================================================================
  158.     Scene_Terminate.prototype = Object.create(Scene_Base.prototype);
  159.     Scene_Terminate.prototype.constructor = Scene_Terminate;

  160.     Scene_Terminate.prototype.start = function() {
  161.         SceneManager.terminate();
  162.     };
  163. })();

复制代码
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1001
在线时间
212 小时
注册时间
2011-11-23
帖子
109
4
 楼主| 发表于 2016-7-7 21:22:38 手机端发表。 | 只看该作者
tseyik 发表于 2016-6-30 09:47

我试过这个插件,貌似只能在游戏里面设置,无法调用插件后自动全屏操作

点评

在游戏里面设置了全屏,以後開機就會全屏  发表于 2016-7-7 23:18
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1001
在线时间
212 小时
注册时间
2011-11-23
帖子
109
5
 楼主| 发表于 2016-7-7 21:25:40 手机端发表。 | 只看该作者
汪汪 发表于 2016-6-30 09:19
Graphics._switchFullScreen()

分辨率似乎没有限制,

嗯,多谢老师,不过不知道老师能不能提供一个合适的分辨率参数,我不管怎么调,窗口模式没有黑边的时候全屏模式下有难看的黑边,全屏模式没有黑边的时候窗口模式有难看的黑边,有没有那个合适的分辨率可以确保两种模式下都没有黑边呢
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
帖子
1516
6
发表于 2016-7-7 23:28:59 | 只看该作者
rkjspb 发表于 2016-7-7 21:25
嗯,多谢老师,不过不知道老师能不能提供一个合适的分辨率参数,我不管怎么调,窗口模式没有黑边的时候全 ...

分辨率参数这种还是和电脑分辨率有关
var wjb51=screen.width;
var hjb51=screen.height;
alert("经系统检测,你的屏幕分辨率为 " + wjb51+"*"+ hjb51 + "by 脚本之家jb51.net");  

这个是获取屏幕分辨率的脚本的样子,
总之参考屏幕分辨率设置吧
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1001
在线时间
212 小时
注册时间
2011-11-23
帖子
109
7
 楼主| 发表于 2016-7-10 11:01:05 | 只看该作者

多谢老师了,话说我还是希望能有个插件能纯粹点只负责全屏功能,插件作者画蛇添足的加了个退出游戏功能
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-6-17 14:45

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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