Skip to content

Instantly share code, notes, and snippets.

@delacannon
Last active March 16, 2016 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delacannon/276b1430519a2337212b to your computer and use it in GitHub Desktop.
Save delacannon/276b1430519a2337212b to your computer and use it in GitHub Desktop.
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