赞 | 2 |
VIP | 0 |
好人卡 | 0 |
积分 | 47 |
经验 | 23847 |
最后登录 | 2024-11-18 |
在线时间 | 1117 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 4671
- 在线时间
- 1117 小时
- 注册时间
- 2014-5-9
- 帖子
- 163
|
Visu_1_BattleCore 中 Actor Battler Settings 选项中 JS:Home Position
// Declare Constants
const sprite = this;
const actor = this._actor;
const index = arguments[0];
// Make Calculations
let x = Math.round((Graphics.width / 2) + 192)
x -= Math.floor((Graphics.width - Graphics.boxWidth) / 2);
x += index * 32;
let y = (Graphics.height - 200) - ($gameParty.maxBattleMembers() * 48);
y -= Math.floor((Graphics.height - Graphics.boxHeight) / 2);
y += index * 48;
// Home Position Offsets
const offsetNote = /<SIDEVIEW HOME OFFSET:[ ]([\+\-]\d+),[ ]([\+\-]\d+)>/i;
const xOffsets = actor.traitObjects().map((obj) => (obj && obj.note.match(offsetNote) ? Number(RegExp.$1) : 0));
const yOffsets = actor.traitObjects().map((obj) => (obj && obj.note.match(offsetNote) ? Number(RegExp.$2) : 0));
x = xOffsets.reduce((r, offset) => r + offset, x);
y = yOffsets.reduce((r, offset) => r + offset, y) - 800;
// Set Home Position
// 设置角色位置
if(index == 0){x=640,y=750};
if(index == 1){x=450,y=750};
if(index == 2){x=450,y=900};
if(index == 3){x=450,y=600};
if(index == 4){x=600,y=280};
this.setHome(x, y); |
|