Skip to content

Instantly share code, notes, and snippets.

@delacannon delacannon/FX_IntroAqua.js
Last active Mar 16, 2016

Embed
What would you like to do?
Rpg Maker MV. FX_IntroAqua Plugin v0.1
//=============================================================================
// FX_IntroAqua
// by Delacannon | delacannon@gmail.com
// Date: 15/03/2015
// Youtube Demo: https://www.youtube.com/watch?v=fba9-otGW7U
//=============================================================================
/*:
* @plugindesc Title texture aqua effect.
* @author Delacannon
*
* @param WavesForce
* @desc Set waves force
* @default 0.5
*/
(function() {
var parameters = PluginManager.parameters('FX_IntroAqua');
var waves_force = Number(parameters['WavesForce'] || 0.5);
var _Scene_Title_update = Scene_Title.prototype.update;
var _Scene_Title_createBackground = Scene_Title.prototype.createBackground;
Scene_Title.prototype.createBackground = function() {
_Scene_Title_createBackground.call(this)
this.container_fx = new PIXI.DisplayObjectContainer();
this.addChild(this.container_fx);
this.container_fx.addChild(this._backSprite1)
var displacementTexture = PIXI.Texture.fromImage("http://tuttlem.github.io/assets/noise1.jpg");
this.displacementFilter = new PIXI.DisplacementFilter(displacementTexture);
this.container_fx.filters = [this.displacementFilter];
}
Scene_Title.prototype.update = function() {
_Scene_Title_update.call(this);
if (this.displacementFilter) {
this.displacementFilter.offset.x -= waves_force;
this.displacementFilter.offset.y += waves_force;
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.