查看: 5255|回复: 7

[原创发布] 仿照mog的脚本写了一个Scene_Option

[复制链接]
梦石
0
星屑
440
在线时间
679 小时
注册时间
2014-3-15
回帖
239

开拓者

发表于 2017-2-22 01:14:27 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 sonicdonggua 于 2017-2-23 16:57 编辑
  1. //=============================================================================
  2. // MOG_SceneOptions.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc (v1.0) 仿Mog创建Scene_Options.
  6. * @author Moghunter
  7. *
  8. * @param Option LayoutX
  9. * @desc 选项命令X坐标。
  10. * @default 238
  11. *
  12. * @param Option LayoutY
  13. * @desc 选项命令Y坐标。
  14. * @default 190
  15. *
  16. * @param Option WLayoutX
  17. * @desc 选项Layout偏移X坐标。
  18. * @default -18
  19. *
  20. * @param Option WLayoutY
  21. * @desc 选项Layout偏移Y坐标。
  22. * @default -37
  23. *
  24. * @help  
  25. * =============================================================================
  26. * +++ MOG拓展 - Scene Options (v1.0) +++
  27. * By Ryosonic
  28. * =============================================================================
  29. * 仿Mog插件制作的Scene_Options。
  30. * 将Layout.png与OptionsLayout.png放入下面的文件夹
  31. * /img/menus/options/
  32. *
  33. */

  34. //=============================================================================
  35. // ** PLUGIN PARAMETERS
  36. //=============================================================================
  37.   var Imported = Imported || {};
  38.    Imported.MOG_SceneFile = true;
  39.    var Moghunter = Moghunter || {};
  40.    Moghunter.parameters = PluginManager.parameters('MOG_SceneOptions');
  41.    Moghunter.scOptions_layoutX = Number(Moghunter.parameters['Option LayoutX'] || 238);
  42.    Moghunter.scOptions_layoutY = Number(Moghunter.parameters['Option LayoutY'] || 190);
  43.    Moghunter.scOptions_WlayoutX = Number(Moghunter.parameters['Option WLayoutX'] || -18);
  44.    Moghunter.scOptions_WlayoutY = Number(Moghunter.parameters['Option WLayoutY'] || -37);
  45.    
  46. //=============================================================================
  47. // ** ImageManager
  48. //=============================================================================

  49. //==============================
  50. // * Menus
  51. //==============================
  52. ImageManager.loadMenusOptions = function(filename) {
  53.     return this.loadBitmap('img/menus/options/', filename, 0, true);
  54. };

  55. //==============================
  56. // * create
  57. //==============================
  58. var _mog_scOptions_create = Scene_Options.prototype.create;
  59. Scene_Options.prototype.create = function() {
  60.     _mog_scOptions_create.call(this);
  61.     this.loadBitmaps();
  62.     this._optionsWindow.opacity = 0;
  63.     this._optionsWindow.x = Moghunter.scOptions_layoutX;
  64.     this._optionsWindow.y = 624;
  65.     this.createSprites();
  66. };

  67. //==============================
  68. // * create Background
  69. //==============================
  70. var _mog_scOptions_createBackground = Scene_Options.prototype.createBackground;
  71. Scene_Options.prototype.createBackground = function() {
  72.         _mog_scOptions_createBackground.call(this);
  73.         this._field = new Sprite();
  74.         this.addChild(this._field);       
  75. }

  76. //==============================
  77. // * loadBitmaps
  78. //==============================
  79. Scene_Options.prototype.loadBitmaps = function() {
  80.         this._layImg = (ImageManager.loadMenusOptions("Layout"));
  81.         this._layOptionsImg = (ImageManager.loadMenusOptions("OptionsLayout"));
  82. };

  83. //==============================
  84. // * create Sprites
  85. //==============================
  86. Scene_Options.prototype.createSprites = function() {
  87.         this.createLayout();
  88.         this.createOptionsLayout();
  89. };

  90. //==============================
  91. // * create Sprites
  92. //==============================
  93. Scene_Options.prototype.createLayout = function() {
  94.         this._layout = new Sprite(this._layImg);
  95.         this._field.addChild(this._layout);
  96. };

  97. //==============================
  98. // * create Options Layout
  99. //==============================
  100. Scene_Options.prototype.createOptionsLayout = function() {
  101.         this._layoutOptions = new Sprite(this._layOptionsImg);
  102.         this._layoutOptions.opacity = 0;
  103.         this._layoutOptions.x = this._optionsWindow.x + Moghunter.scOptions_WlayoutX;
  104.         this._layoutOptions.y = 624 + Moghunter.scOptions_WlayoutY;
  105.         this._field.addChild(this._layoutOptions);
  106. };

  107. //==============================
  108. // * update Slide
  109. //==============================
  110. Scene_Options.prototype.updateSlide = function() {
  111.         this._optionsWindow.opacity = 0;
  112.         this._optionsWindow.contentsOpacity += 5;
  113.         if (this._optionsWindow.y > Moghunter.scOptions_layoutY) {
  114.                 this._optionsWindow.y -= 10;
  115.                 this._layoutOptions.y -= 10;
  116.                 this._layoutOptions.opacity = this._optionsWindow.contentsOpacity;
  117.                 if (this._optionsWindow.y <= Moghunter.scOptions_layoutY){
  118.                 this._optionsWindow.y = Moghunter.scOptions_layoutY;
  119.                 this._layoutOptions.y = Moghunter.scOptions_layoutY + Moghunter.scOptions_WlayoutY
  120. };
  121.         };
  122. };

  123. //==============================
  124. // * Update
  125. //==============================
  126. var _mog_scOptions_update = Scene_Options.prototype.update;
  127. Scene_Options.prototype.update = function() {
  128.         _mog_scOptions_update.call(this);
  129.          if(this._layImg.isReady()) this.updateSlide();
  130. };
复制代码

Mog华丽菜单有menus、item、equip、skill、status与file,缺少了party、options与end。party可以通过放个背景达到美观效果、scene_end我直接删掉了改成了一按就退出,options就必须要动动手了。
Mog的插件特点是建立Window,然后设定透明度为0,然后配合贴图与移动效果达到美观的特点。
仿照Mog的风格写的,当然为了整齐直接盗用了Mog的名字作为参数{:2_258:} ,这样算是添加了一个小小的动画效果。
需要准备layout与OptionsLayout两个文件,放到img/menus/Options/文件夹下

评分

参与人数 2星屑 +200 收起 理由
月下耶鲁夫 + 190 造福社会
白嫩白嫩的 + 10 大神辛苦了

查看全部评分

梦石
0
星屑
2582
在线时间
363 小时
注册时间
2015-8-15
回帖
66
发表于 2017-2-23 15:24:04 | 显示全部楼层
大神,能否发张效果图看看是怎样布局的
回复

使用道具 举报

梦石
0
星屑
440
在线时间
679 小时
注册时间
2014-3-15
回帖
239

开拓者

 楼主| 发表于 2017-2-23 17:00:03 | 显示全部楼层
本帖最后由 sonicdonggua 于 2017-2-23 17:01 编辑
梦幻のLoli塔 发表于 2017-2-23 15:24
大神,能否发张效果图看看是怎样布局的


代码写的太仓促,稍微改了一下。不好意思。
最后的效果是optionwindow停到了屏幕中间
屏幕快照 2017-02-23 下午4.58.55.png
回复

使用道具 举报

梦石
0
星屑
65
在线时间
105 小时
注册时间
2011-8-14
回帖
41
发表于 2017-2-24 19:57:40 | 显示全部楼层
希望有一天能把Yanfly的界面全部美化。
回复

使用道具 举报

梦石
0
星屑
1857
在线时间
2678 小时
注册时间
2010-6-26
回帖
3008

开拓者整合系统大赛RMVX达人剧作品鉴家

发表于 2017-2-24 22:23:54 | 显示全部楼层
感谢楼主的无私共享,很赞~

      情人怨遥夜,竟夕起相思
回复

使用道具 举报

梦石
0
星屑
2582
在线时间
363 小时
注册时间
2015-8-15
回帖
66
发表于 2019-8-26 17:15:10 | 显示全部楼层
这个插件启动不了啊,请问要写什么东西吗?
回复

使用道具 举报

梦石
0
星屑
426
在线时间
72 小时
注册时间
2019-7-30
回帖
32
发表于 2019-8-29 16:32:00 | 显示全部楼层
谢谢分享,收下了
回复

使用道具 举报

梦石
0
星屑
992
在线时间
108 小时
注册时间
2022-7-2
回帖
133
发表于 2022-7-6 15:47:21 | 显示全部楼层
6666666666
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部