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

Project1

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

[已经解决] 这个状态插件如何改坐标

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
491 小时
注册时间
2015-1-7
帖子
124
跳转到指定楼层
1
发表于 2015-12-26 20:25:48 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 西姐 于 2015-12-26 20:28 编辑

我想把它改成这样的

我想把人物的立绘带入变量,我之前VA搞过,XX+变量显示立绘,这样可以让玩家选择自己想要的立绘。。

RUBY 代码复制
  1. //=============================================================================
  2. // MrTS_LuminusStatus.js
  3. //=============================================================================
  4.  
  5. /*:
  6. * @plugindesc Luminus Status Screen. Changes how data is displayed there.
  7. * @author Mr. Trivel
  8. *
  9. * @param Short Attack
  10. * @desc Short text for Attack
  11. * Default: ATK
  12. * @default ATK
  13. *
  14. * @param Short Defense
  15. * @desc Short text for Defense
  16. * Default: DEF
  17. * @default DEF
  18. *
  19. * @param Short MAttack
  20. * @desc Short text for Magical Attack
  21. * Default: MAT
  22. * @default MAT
  23. *
  24. * @param Short MDefense
  25. * @desc Short text for MDefense
  26. * Default: MDF
  27. * @default MDF
  28. *
  29. * @param Short Agility
  30. * @desc Short text for Agility
  31. * Default: AGI
  32. * @default AGI
  33. *
  34. * @param Short Luck
  35. * @desc Short text for Luck
  36. * Default: LUK
  37. * @default LUK
  38. *
  39. * @help
  40. * --------------------------------------------------------------------------------
  41. * Free for non commercial use.
  42. * Version 1.0
  43. * --------------------------------------------------------------------------------
  44. *
  45. * --------------------------------------------------------------------------------
  46. * Required Files
  47. * --------------------------------------------------------------------------------
  48. * "img\system\LuminusBackground.png" - At least as big as screen. Background.
  49. * "img\system\LuminusStatus.png" - 348x539 - Background for stats and equipment.
  50. * "img\system\LuminusBar.png" - 324x48 - background for equipment.
  51. * "img\system\LuminusSeparator.png" - 327x9 - separator bar between blocks.
  52. * "img\system\LuminusStatusName.png" - 264x70 - Status Scene name in top right.
  53. * "img\system\LuminusActor#.png" - any preferred size. # - Actor ID
  54. *    E.g. LuminusActor5.png would be actor's with ID 5 image.
  55. * "img\system\LuminusBottomBar.png" - 40height, width - as big as screen.
  56. *    Is at the very bottom of status screen. Can be used to display controls.
  57. *
  58. *
  59. * --------------------------------------------------------------------------------
  60. * Map Tags
  61. * --------------------------------------------------------------------------------
  62. * <LuminusBackground: [FILENAME]>
  63. * Luminus Status Scene background is set depending on the map you're in.
  64. * If no tag set it uses default background - "LuminusBackground".
  65. * --------------------------------------------------------------------------------
  66. * Version History
  67. * --------------------------------------------------------------------------------
  68. * 1.0 - Release
  69. */
  70.  
  71. (function() {
  72.  
  73.         var parameters = PluginManager.parameters('MrTS_LuminusStatus');
  74.         var paramATK  = String(parameters['Short Attack']         || "ATK")
  75.         var paramDEF  = String(parameters['Short Defense']         || "DEF")
  76.         var paramMATK = String(parameters['Short MAttack']         || "MAT")
  77.         var paramMDEF = String(parameters['Short MDefense'] || "MDF")
  78.         var paramAGI  = String(parameters['Short Agility']         || "AGI")
  79.         var paramLUK  = String(parameters['Short Luck']         || "LUK")
  80.  
  81.         Scene_Status.prototype.create = function() {
  82.             Scene_MenuBase.prototype.create.call(this);
  83.             this._statusWindow = new Window_Status();
  84.             this._statusWindow.setHandler('cancel',   this.popScene.bind(this));
  85.             this._statusWindow.setHandler('pagedown', this.nextActor.bind(this));
  86.             this._statusWindow.setHandler('pageup',   this.previousActor.bind(this));
  87.             this.addWindow(this._statusWindow);
  88.             this.refreshActor();
  89.         };
  90.  
  91.         Scene_Status.prototype.createBackground = function() {
  92.             this._backgroundSprite = new Sprite();
  93.             if ($dataMap.meta.LuminusBackground)
  94.             {
  95.                     var fileName = String($dataMap.meta.LuminusBackground);
  96.                     if (fileName[0] == " ") fileName = fileName.substring(1);
  97.                     this._backgroundSprite.bitmap = ImageManager.loadSystem(fileName);
  98.             }
  99.             else
  100.                     this._backgroundSprite.bitmap = ImageManager.loadSystem("LuminusBackground");
  101.             this.addChild(this._backgroundSprite);
  102.  
  103.             this._statusBackground = new Sprite();
  104.             this._statusBackground.bitmap = ImageManager.loadSystem("LuminusStatus");
  105.             this._statusBackground.x = 30;
  106.             this._statusBackground.y = Graphics.boxHeight/2 - 540/2;
  107.             this.addChild(this._statusBackground);
  108.  
  109.             this._actorSprite = new Sprite()
  110.             this.addChild(this._actorSprite);
  111.  
  112.             this._barSprites = [];
  113.             var equips = $gameActors.actor(1).equips();
  114.             for (var i = 0; i < equips.length; i++) {
  115.                     var sprite = new Sprite();
  116.                     sprite.bitmap = ImageManager.loadSystem("LuminusBar");
  117.                     sprite.x = this._statusBackground.x + 9;
  118.                     sprite.y = this._statusBackground.y + 250 + 48*i;
  119.                         this.addChild(sprite);
  120.             };
  121.  
  122.             this._bottomBarSprite = new Sprite();
  123.             this._bottomBarSprite.bitmap = ImageManager.loadSystem("LuminusBottomBar");
  124.             this._bottomBarSprite.y = Graphics.boxHeight - 40;
  125.             this.addChild(this._bottomBarSprite);
  126.  
  127.             this._statusName = new Sprite();
  128.             this._statusName.bitmap = ImageManager.loadSystem("LuminusStatusName");
  129.             var sprite = this._statusName;
  130.             sprite.bitmap.addLoadListener(function() {
  131.                     sprite.x = Graphics.width - sprite.width;
  132.             });
  133.             this.addChild(this._statusName);
  134.         };
  135.  
  136.         Scene_Status.prototype.refreshActor = function() {
  137.             var actor = this.actor();
  138.             this._statusWindow.setActor(actor);
  139.             var actorSprite = this._actorSprite;
  140.             var statusSprite = this._statusBackground;
  141.  
  142.             actorSprite.bitmap = ImageManager.loadSystem("LuminusActor" + actor.actorId());
  143.             actorSprite.bitmap.addLoadListener(function() {
  144.                     var w = Graphics.boxWidth - statusSprite.x - statusSprite.width;
  145.                     var x = statusSprite.x + statusSprite.width;
  146.                     var y = Graphics.boxHeight - actorSprite.height;
  147.                     if (y < 0) y = 0;
  148.                     actorSprite.x = x + w/2 - actorSprite.width/2;
  149.                     actorSprite.y = y;
  150.             });
  151.         };
  152.  
  153.         Window_Status.prototype.initialize = function() {
  154.             var width = Graphics.boxWidth;
  155.             var height = Graphics.boxHeight;
  156.             Window_Selectable.prototype.initialize.call(this, 0, 0, width, height);
  157.             this.refresh();
  158.             this.activate();
  159.             this.opacity = 0;
  160.         };
  161.  
  162.         Window_Status.prototype.refresh = function() {
  163.             this.contents.clear();
  164.  
  165.             var positions = [];
  166.             var x = 30 - this.standardPadding();
  167.  
  168.             if (this._actor) {
  169.                     var actor = this._actor;
  170.                 var lineHeight = this.lineHeight();
  171.  
  172.                 var y = Graphics.boxHeight/2 - 540/2 - this.standardPadding() + 8;
  173.                 var mw = 348/2;
  174.                 this.drawText(TextManager.levelA, x + 9, y);
  175.                 this.drawText(actor.level, x, y, mw - 6, 'right');
  176.                 this.drawText(actor.name(), x + mw, y, mw, 'center');
  177.  
  178.                 y += lineHeight;
  179.                 this.drawText(TextManager.exp, x + 9, y, mw - 6);
  180.                 var exp = (actor.currentExp()-actor.currentLevelExp()) + "/" + (actor.nextLevelExp()-actor.currentLevelExp());
  181.                 this.drawText(exp, x, y, mw*2-12, 'right');
  182.  
  183.                 y += lineHeight;
  184.                 this.drawText(TextManager.hpA, x + 9, y);
  185.                 var hp = actor.hp + "/" + actor.mhp;
  186.                 var whp = this.textWidth(hp);
  187.                 this.drawText(hp, x, y, mw - 6, 'right');
  188.                 this.drawText(TextManager.mpA, x + mw + 6, y);
  189.                 var mp = actor.mp + "/" + actor.mmp;
  190.                 this.drawText(mp, mw, y, mw, 'right');
  191.  
  192.                 y += lineHeight;
  193.                 positions.push(y)
  194.  
  195.                 y += lineHeight/3;
  196.                 var sw = mw  - this.textWidth(paramATK);
  197.                 var swx = this.textWidth(paramATK);
  198.                 this.drawText(paramATK, x + 9, y);
  199.                 this.drawText(actor.atk, x + swx, y, sw, 'center');
  200.                 this.drawText(paramDEF, x + mw + 6, y);
  201.                 this.drawText(actor.def, mw + swx, y, sw, 'center');
  202.  
  203.                 y += lineHeight;
  204.                 this.drawText(paramMATK, x + 9, y);
  205.                 this.drawText(actor.mat, x + swx, y, sw, 'center');
  206.                 this.drawText(paramMDEF, x + mw + 6, y);
  207.                 this.drawText(actor.mdf, mw + swx, y, sw, 'center');
  208.  
  209.                 y += lineHeight;
  210.                 this.drawText(paramAGI, x + 9, y);
  211.                 this.drawText(actor.agi, x + swx, y, sw, 'center');
  212.                 this.drawText(paramLUK, x + mw + 6, y);
  213.                 this.drawText(actor.luk, mw + swx, y, sw, 'center');
  214.  
  215.                 y += lineHeight;
  216.                 positions.push(y);
  217.  
  218.                 y += lineHeight/3+2;
  219.                 var equips = this._actor.equips();
  220.                     var count = Math.min(equips.length, this.maxEquipmentLines());
  221.                     for (var i = 0; i < count; i++) {
  222.                             this.drawItemName(equips[i], x + 18, y + 48 * i + 6);
  223.                     }
  224.             }
  225.  
  226.             var bitmapSeparator = ImageManager.loadSystem("LuminusSeparator");
  227.             var c = this.contents;
  228.             bitmapSeparator.addLoadListener(function() {
  229.                     for (var i = 0; i < positions.length; i ++)
  230.                             c.blt(bitmapSeparator, 0, 0, bitmapSeparator.width, bitmapSeparator.height, x + 9, positions[i]);
  231.             });
  232.         };
  233.  
  234.         Window_Status.prototype.drawVertLine = function(x) {
  235.             this.contents.paintOpacity = 48;
  236.             this.contents.fillRect(x, 0, 2, this.contentsHeight(), this.lineColor());
  237.             this.contents.paintOpacity = 255;
  238.         };
  239. })();

Lv3.寻梦者

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
帖子
1516
2
发表于 2015-12-26 20:38:15 | 只看该作者
  actorSprite.bitmap = ImageManager.loadSystem("LuminusActor" + actor.actorId());
            actorSprite.bitmap.addLoadListener(function() {
                    var w = Graphics.boxWidth - statusSprite.x - statusSprite.width;
                    var x = statusSprite.x + statusSprite.width;
                    var y = Graphics.boxHeight - actorSprite.height;
                    if (y < 0) y = 0;
                    actorSprite.x = x + w/2 - actorSprite.width/2;
                    actorSprite.y = y;
            });
这一句?

点评

多谢,刚发完帖子,我就搜到怎么带入变量了。。。。  发表于 2015-12-26 20:54

评分

参与人数 1梦石 +1 收起 理由
余烬之中 + 1 /w\

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-12-23 02:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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