alias initialize_rhyme initialize
def initialize
initialize_rhyme
@t_display_x = @display_x
@t_display_y = @display_y
end
#--------------------------------------------------------------------------
# ● Set Display Position
#--------------------------------------------------------------------------
def set_display_pos(x, y)
x = [0, [x, width - screen_tile_x].min].max unless loop_horizontal?
y = [0, [y, height - screen_tile_y].min].max unless loop_vertical?
@t_display_x = @display_x = (x + width) % width
@t_display_y = @display_y = (y + height) % height
@parallax_x = x
@parallax_y = y
end
#----
// FROM THE ORIGINAL JS FILE
Game_Map.prototype.setDisplayPos = function(x, y) {
if (this.isLoopHorizontal()) {
this._displayX = x.mod(this.width());
this._parallaxX = x;
} else {
var endX = this.width() - this.screenTileX();
this._displayX = endX < 0 ? endX / 2 : x.clamp(0, endX);
this._parallaxX = this._displayX;
}
if (this.isLoopVertical()) {
this._displayY = y.mod(this.height());
this._parallaxY = y;
} else {
var endY = this.height() - this.screenTileY();
this._displayY = endY < 0 ? endY / 2 : y.clamp(0, endY);
this._parallaxY = this._displayY;
}
};