Why aren't you directly using the screenX() and screenY() functions of Game_CharacterBase? It is calculating the jumps and so on directly.
Or at least, if you prefer the raw positions of events, you can use the functions scrolledX() and scrolledY(). My own lighting code uses this:
Code:
const real_coords = this.getPixelCoordinates(evt.scrolledX(), evt.scrolledY());
this._maskBitmap.fillGradientCircle(real_coords.x, real_coords.y, circle_radius, colorString1, colorString2);Code:
LightingMask.prototype.getPixelCoordinates = function(x,y) {
const tile_width = $gameMap.tileWidth();
const tile_height = $gameMap.tileHeight();
const rx = tile_width * (x + 0.5) + 20;
const ry = tile_height * (y + 0.5) + 20;
return new Point(rx,ry);
}I have +20 in x and Y to accommodate shakes in both directions