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

Project1

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

[有事请教] 有无懂js的小伙伴帮我看看立绘xy的设置

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1117
在线时间
141 小时
注册时间
2006-2-12
帖子
219
跳转到指定楼层
1
发表于 2023-8-4 17:24:29 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如图我的立绘被切头了,插件预留的js定义的代码如下:
JS 代码复制
  1. // Declare Constants
  2. const maxExp = '-------';
  3. const lineHeight = this.lineHeight();
  4. const gaugeLineHeight = this.gaugeLineHeight();
  5. const basicDataHeight = lineHeight * 6.5;
  6. const actor = this._actor;
  7. const padding = this.itemPadding();
  8. const halfWidth = this.innerWidth / 2;
  9. let rect = new Rectangle(0, 0, halfWidth, this.innerHeight);
  10. let x = 0;
  11. let y = 0;
  12.  
  13. // Draw Actor Graphic
  14. this.drawActorGraphic(0, this.innerWidth / 2);
  15.  
  16. // Declare Smaller Data Area
  17. let sx = rect.x;
  18. let sy = Math.max(rect.y, rect.y + (rect.height - basicDataHeight));
  19. let sw = rect.width;
  20. let sh = rect.y + rect.height - sy;
  21.  
  22. // Draw Actor Name
  23. this.drawItemDarkRect(0, sy, sw, lineHeight, 2);
  24. this.drawText(actor.name(), sx, sy, sw, 'center');
  25.  
  26. // Draw Actor Level
  27. sx = rect.x + Math.round((rect.width - 128) / 2);
  28. sy += lineHeight;
  29. this.drawItemDarkRect(0, sy, sw, lineHeight);
  30. this.drawActorLevel(actor, sx, sy);
  31.  
  32. // Draw Actor Class
  33. const className = actor.currentClass().name;
  34. sx = rect.x + Math.round((rect.width - this.textSizeEx(className).width) / 2);
  35. sy += lineHeight;
  36. this.drawItemDarkRect(0, sy, sw, lineHeight);
  37. this.drawTextEx(className, sx, sy, sw);
  38.  
  39. // Draw Actor Icons
  40. sx = rect.x + Math.round((rect.width - 144) / 2);
  41. sy += lineHeight;
  42. this.drawItemDarkRect(0, sy, sw, lineHeight);
  43. this.drawActorIcons(actor, sx, sy);
  44.  
  45. // Draw Gauges
  46. sx = rect.x + Math.round((rect.width - 128) / 2);
  47. sy += lineHeight;
  48. this.drawItemDarkRect(0, sy, sw, this.innerHeight - sy);
  49. this.placeGauge(actor, "hp", sx, sy);
  50. sy += gaugeLineHeight;
  51. this.placeGauge(actor, "mp", sx, sy);
  52. sy += gaugeLineHeight;
  53. if ($dataSystem.optDisplayTp) {
  54.     this.placeGauge(actor, "tp", sx, sy);
  55. }
  56.  
  57. // Declare Second Half
  58. rect = new Rectangle(halfWidth, 0, halfWidth, this.innerHeight);
  59.  
  60. // Draw EXP
  61. this.changeTextColor(ColorManager.systemColor());
  62. this.drawItemDarkRect(rect.x, rect.y, rect.width, lineHeight, 2);
  63. this.drawText(TextManager.exp, rect.x, rect.y, rect.width, 'center');
  64. const expHeight = lineHeight * 5;
  65. this.drawItemDarkRect(rect.x, rect.y + lineHeight * 1, rect.width, lineHeight * 2);
  66. this.drawItemDarkRect(rect.x, rect.y + lineHeight * 3, rect.width, lineHeight * 2);
  67. const expTotal = TextManager.expTotal.format(TextManager.exp);
  68. const expNext = TextManager.expNext.format(TextManager.level);
  69. this.changeTextColor(ColorManager.systemColor());
  70. this.drawText(expTotal, rect.x + padding, rect.y + lineHeight * 1, rect.width - padding * 2);
  71. this.drawText(expNext, rect.x + padding, rect.y + lineHeight * 3, rect.width - padding * 2);
  72. this.resetTextColor();
  73. const expTotalValue = actor.currentExp();
  74. const expNextValue = actor.isMaxLevel() ? maxExp : actor.nextRequiredExp();
  75. this.drawText(expTotalValue, rect.x + padding, rect.y + lineHeight * 1, rect.width - padding * 2, 'right');
  76. this.drawText(expNextValue, rect.x + padding, rect.y + lineHeight * 3, rect.width - padding * 2, 'right');
  77.  
  78. // Declare Parameters
  79. const params1 = this.getParameterList(1);
  80. const nameWidth = rect.width - padding * 2 - this.textWidth('88888');
  81.  
  82. // Draw Parameters 1
  83. x = rect.x + padding;
  84. y = rect.y + expHeight;
  85. this.changeTextColor(ColorManager.systemColor());
  86. this.drawItemDarkRect(rect.x, y, rect.width, lineHeight, 2);
  87. this.drawText(TextManager.statusMenuBiography, rect.x, y, rect.width, 'center');
  88. this.resetTextColor();
  89. paramWidth = rect.width - (padding * 2);
  90. for (const paramId of params1) {
  91.     this.changeTextColor(ColorManager.systemColor());
  92.     this.drawItemDarkRect(rect.x, y + lineHeight * 1, rect.width, lineHeight);
  93.     this.drawParamName(paramId, x, y + lineHeight * 1, nameWidth);
  94.     this.resetTextColor();
  95.     this.drawParamValue(paramId, x, y + lineHeight * 1, paramWidth);
  96.     y += lineHeight;
  97. }
  98. this.drawItemDarkRect(rect.x, y, rect.width, this.innerHeight - y);

5401691141037_.pic.jpg (329.19 KB, 下载次数: 2)

5401691141037_.pic.jpg

Lv3.寻梦者

梦石
0
星屑
3813
在线时间
369 小时
注册时间
2012-2-19
帖子
47
2
发表于 2023-8-4 18:00:35 | 只看该作者
有没有一种可能,是你的图片太大了
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1117
在线时间
141 小时
注册时间
2006-2-12
帖子
219
3
 楼主| 发表于 2023-8-4 18:02:05 | 只看该作者
sundeshuo 发表于 2023-8-4 18:00
有没有一种可能,是你的图片太大了

可是我需要这么大啊,我的意思是我要挪动y轴让头显示出来,下半身可以出框
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3813
在线时间
369 小时
注册时间
2012-2-19
帖子
47
4
发表于 2023-8-4 18:14:02 | 只看该作者
应该没法改,他那个drawActorGraphic函数改不了
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1117
在线时间
141 小时
注册时间
2006-2-12
帖子
219
5
 楼主| 发表于 2023-8-4 21:04:09 | 只看该作者
sundeshuo 发表于 2023-8-4 18:14
应该没法改,他那个drawActorGraphic函数改不了

自己解决了,直接从 物品装备菜单里面复制代码过来
替换成:

// Draw Menu Image
this.drawItemActorMenuImage(this._actor, 0, 0, this.innerWidth / 2, this.innerHeight * 1.8);
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-4 02:41

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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