//----------------------------------------------------------------------------- // MBS_MapZoom fixes //----------------------------------------------------------------------------- Game_Map.prototype.onZoomChange = function() { $gamePlayer.center((this._zoomCenter || $gamePlayer)._realX, (this._zoomCenter || $gamePlayer)._realY); }; //----------------------------------------------------------------------------- // Galv Smooth Cam Fixes + Mapzoom compatability //----------------------------------------------------------------------------- Galv.CC.Game_Map_setupMBSPatch = Game_Map.prototype.setup; Game_Map.prototype.setup = function(mapId) { this.zoom = this.zoom || new PIXI.Point(1,1); Galv.CC.Game_Map_setupMBSPatch.call(this,mapId); }; Galv.CC.Game_Map_updateScroll = Game_Map.prototype.updateScroll; Game_Map.prototype.updateScroll = function() { if (this.camNorm) return Galv.CC.Game_Map_updateScroll.call(this); this._scrollRest = 0; var cw = (Graphics.boxWidth / 2); var ch = (Graphics.boxHeight / 2); var screenX = this.camTarget.screenX() * this.zoom.x; var screenY = this.camTarget.screenY() * this.zoom.y; var sx = Math.abs(screenX - cw) / this.camSpeed; var sy = Math.abs(screenY - ch) / this.camSpeed; if (sx < 0.005) (sx = 0); if (sy < 0.005) (sy = 0); var x_pos = screenX; var y_pos = screenY; if (y_pos < ch) { this.scrollUp(sy); } else if (y_pos > ch) { this.scrollDown(sy); } ; if (x_pos < cw) { this.scrollLeft(sx); } else if (x_pos > cw) { this.scrollRight(sx); } }; //Fixed weird jump at start of map Game_Player.prototype.centerX = function() { return ((Graphics.width / $gameMap.tileWidth() - (1*$gameMap.zoom.x)) / 2.0)/$gameMap.zoom.x; }; Game_Player.prototype.centerY = function() { return ((Graphics.height / $gameMap.tileHeight() - 1.75*$gameMap.zoom.y) / 2.0)/$gameMap.zoom.y; };