Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Declare Constants
- const sprite = this;
- const actor = this._actor;
- const index = arguments[0];
- // Make Calculations
- const battlerSpacing = 200; // Increase this value to add more space between battlers
- let x = Math.round((Graphics.width / 2) - ($gameParty.maxBattleMembers() * battlerSpacing / 2) + (index * battlerSpacing));
- x -= Math.floor((Graphics.width - Graphics.boxWidth) / 2);
- let y = Graphics.height - 150;
- y -= Math.floor((Graphics.height - Graphics.boxHeight) / 2);
- // 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);
- // Set Home Position
- this.setHome(x, y);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement