There are always black bars on both sides, even if loop is set to true.
Any fix to parallax during screen shake yet?
RPG Maker MZ SupportDoes that happen because of the width of things?
How wide is the map? How wide is the screen size? How wide is the parallax?
Might be worth trying to increase the map width or maybe parallax image width to be bigger than screen size.
How wide is the map? How wide is the screen size? How wide is the parallax?
Might be worth trying to increase the map width or maybe parallax image width to be bigger than screen size.
It doesn't matter how big the parallax image or map is, there will always be black bars.
I guess it's related to the tiling sprite render bounds, and the fact that Shake Screen moves the entire spriteset, children and all. Maybe this helps?
[Edit: corrected
JavaScript:
/*:
* @target MZ
* @plugindesc Anti-shake for parallax.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/174980/
* @help Free to use and/or modify for any project, no credit required.
*/
;void (alias => {
Spriteset_Map.prototype.updateParallax = function() {
alias.apply(this, arguments);
this._parallax.x = -Math.round($gameScreen.shake());
};
})(Spriteset_Map.prototype.updateParallax);
[Edit: corrected
screen to $gameScreen.]Oh I see you make it not shake with the screen.
It should be $gameScreen, not screen.
But yes, that fix the problem, in a way.
:hswt:
It should be $gameScreen, not screen.
But yes, that fix the problem, in a way.
:hswt:
Oops, I blindly copied it from the core method that uses a local
screen variable. Fixed, thanks!Yep, just shake it in the other direction. MV-style animations and enemy sprites both do something similar. If you still wanted a shaky parallax, you could try adding a line to offset its tiling origin:
JavaScript:
this._parallax.origin.x += Math.round($gameScreen.shake());
+ sign might need to be a -. May also want to scale this shake magnitude using checks similar to those found in Game_Map#parallaxOx.Yeah I think it is correct to leave the background unshaked.
Thank you, I think this topic can be closed now.👍
Thank you, I think this topic can be closed now.👍
This thread is closed due to being indicated as solved. Report the next one so we can find it! If you need this one reopened, report it to let us know. Thank you!
Original thread: https://forums.rpgmakerweb.com/threads/any-fix-to-parallax-during-screen-shake-yet.174980/