Change current parallax's speed/graphic

Is there any script call to do something like:

@game_map.parallax.speed +=1@game_map.parallax.setGraphic("mountainNight");I'm asking cause I'm working a runner kinda game and want to have the background speed up and change during game.
Does using the 'Change Parallax Back' event command on tab 3 do what you are after?
It could do the job with some if-elses but If I could just increment the speed based on the current speed directly, I'd rather.
Game Interpreter will show you the script call for each of the event commands.


Try this:


$game_map.change_parallax(name, loop_x, loop_y, sx, sy)


The one thing I'd question is whether it would reset the parallax to the original position, or just keep it where it is and change the speed.


If it doesn't work, you'd have to write a method to accept the parameters and just change those variables you want to change - or make them attr_accessors and change them individually via a script call.
Game Interpreter will show you the script call for each of the event commands.

Try this:

$game_map.change_parallax(name, loop_x, loop_y, sx, sy)

The one thing I'd question is whether it would reset the parallax to the original position, or just keep it where it is and change the speed.

If it doesn't work, you'd have to write a method to accept the parameters and just change those variables you want to change - or make them attr_accessors and change them individually via a script call.
Thanks Shaz that works just like you said and it doesn't reset the image back. I made a quick function for what I needed, posting it below for anyone interested:

Code:
 def increase_parallax_speed(sx, sy)    @parallax_sx += sx    @parallax_sy += sy  end
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/change-current-parallaxs-speed-graphic.17334/