查看: 4356|回复: 4

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

[复制链接]
梦石
0
星屑
1336
在线时间
158 小时
注册时间
2006-2-12
回帖
157
发表于 2023-8-4 17:24:29 | 显示全部楼层 |阅读模式

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

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

×
如图我的立绘被切头了,插件预留的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. // Draw Actor Graphic
  13. this.drawActorGraphic(0, this.innerWidth / 2);

  14. // Declare Smaller Data Area
  15. let sx = rect.x;
  16. let sy = Math.max(rect.y, rect.y + (rect.height - basicDataHeight));
  17. let sw = rect.width;
  18. let sh = rect.y + rect.height - sy;

  19. // Draw Actor Name
  20. this.drawItemDarkRect(0, sy, sw, lineHeight, 2);
  21. this.drawText(actor.name(), sx, sy, sw, 'center');

  22. // Draw Actor Level
  23. sx = rect.x + Math.round((rect.width - 128) / 2);
  24. sy += lineHeight;
  25. this.drawItemDarkRect(0, sy, sw, lineHeight);
  26. this.drawActorLevel(actor, sx, sy);

  27. // Draw Actor Class
  28. const className = actor.currentClass().name;
  29. sx = rect.x + Math.round((rect.width - this.textSizeEx(className).width) / 2);
  30. sy += lineHeight;
  31. this.drawItemDarkRect(0, sy, sw, lineHeight);
  32. this.drawTextEx(className, sx, sy, sw);

  33. // Draw Actor Icons
  34. sx = rect.x + Math.round((rect.width - 144) / 2);
  35. sy += lineHeight;
  36. this.drawItemDarkRect(0, sy, sw, lineHeight);
  37. this.drawActorIcons(actor, sx, sy);

  38. // Draw Gauges
  39. sx = rect.x + Math.round((rect.width - 128) / 2);
  40. sy += lineHeight;
  41. this.drawItemDarkRect(0, sy, sw, this.innerHeight - sy);
  42. this.placeGauge(actor, "hp", sx, sy);
  43. sy += gaugeLineHeight;
  44. this.placeGauge(actor, "mp", sx, sy);
  45. sy += gaugeLineHeight;
  46. if ($dataSystem.optDisplayTp) {
  47.     this.placeGauge(actor, "tp", sx, sy);
  48. }

  49. // Declare Second Half
  50. rect = new Rectangle(halfWidth, 0, halfWidth, this.innerHeight);

  51. // Draw EXP
  52. this.changeTextColor(ColorManager.systemColor());
  53. this.drawItemDarkRect(rect.x, rect.y, rect.width, lineHeight, 2);
  54. this.drawText(TextManager.exp, rect.x, rect.y, rect.width, 'center');
  55. const expHeight = lineHeight * 5;
  56. this.drawItemDarkRect(rect.x, rect.y + lineHeight * 1, rect.width, lineHeight * 2);
  57. this.drawItemDarkRect(rect.x, rect.y + lineHeight * 3, rect.width, lineHeight * 2);
  58. const expTotal = TextManager.expTotal.format(TextManager.exp);
  59. const expNext = TextManager.expNext.format(TextManager.level);
  60. this.changeTextColor(ColorManager.systemColor());
  61. this.drawText(expTotal, rect.x + padding, rect.y + lineHeight * 1, rect.width - padding * 2);
  62. this.drawText(expNext, rect.x + padding, rect.y + lineHeight * 3, rect.width - padding * 2);
  63. this.resetTextColor();
  64. const expTotalValue = actor.currentExp();
  65. const expNextValue = actor.isMaxLevel() ? maxExp : actor.nextRequiredExp();
  66. this.drawText(expTotalValue, rect.x + padding, rect.y + lineHeight * 1, rect.width - padding * 2, 'right');
  67. this.drawText(expNextValue, rect.x + padding, rect.y + lineHeight * 3, rect.width - padding * 2, 'right');

  68. // Declare Parameters
  69. const params1 = this.getParameterList(1);
  70. const nameWidth = rect.width - padding * 2 - this.textWidth('88888');

  71. // Draw Parameters 1
  72. x = rect.x + padding;
  73. y = rect.y + expHeight;
  74. this.changeTextColor(ColorManager.systemColor());
  75. this.drawItemDarkRect(rect.x, y, rect.width, lineHeight, 2);
  76. this.drawText(TextManager.statusMenuBiography, rect.x, y, rect.width, 'center');
  77. this.resetTextColor();
  78. paramWidth = rect.width - (padding * 2);
  79. for (const paramId of params1) {
  80.     this.changeTextColor(ColorManager.systemColor());
  81.     this.drawItemDarkRect(rect.x, y + lineHeight * 1, rect.width, lineHeight);
  82.     this.drawParamName(paramId, x, y + lineHeight * 1, nameWidth);
  83.     this.resetTextColor();
  84.     this.drawParamValue(paramId, x, y + lineHeight * 1, paramWidth);
  85.     y += lineHeight;
  86. }
  87. this.drawItemDarkRect(rect.x, y, rect.width, this.innerHeight - y);
复制代码
5401691141037_.pic.jpg
梦石
0
星屑
6814
在线时间
461 小时
注册时间
2012-2-19
回帖
37
发表于 2023-8-4 18:00:35 | 显示全部楼层
有没有一种可能,是你的图片太大了
回复

使用道具 举报

梦石
0
星屑
1336
在线时间
158 小时
注册时间
2006-2-12
回帖
157
 楼主| 发表于 2023-8-4 18:02:05 | 显示全部楼层
sundeshuo 发表于 2023-8-4 18:00
有没有一种可能,是你的图片太大了

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

使用道具 举报

梦石
0
星屑
6814
在线时间
461 小时
注册时间
2012-2-19
回帖
37
发表于 2023-8-4 18:14:02 | 显示全部楼层
应该没法改,他那个drawActorGraphic函数改不了
回复

使用道具 举报

梦石
0
星屑
1336
在线时间
158 小时
注册时间
2006-2-12
回帖
157
 楼主| 发表于 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);
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部