Advertisement
CompanionWulf

Random Loading Image (RMMV)

Nov 29th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=================================================================
  2. // Random Loading Image v1.0
  3. //      * This plugin allows you to use customized "Loading..." images and
  4. //        randomize them. This was originally written specifically for "The
  5. //        Adventures of Tryggr".
  6. //
  7. // © 2015, Companion Wulf
  8. //
  9. //=================================================================
  10. // RandomLoadingImage.js
  11. //=================================================================
  12.  
  13. /*:
  14.  * @plugindesc Changes the default "Loading..." image to a random one.
  15.  * @author Companion Wulf
  16.  *
  17.  * @param Number of Images
  18.  * @desc The total number of "Loading" images used.
  19.  * @default 3
  20.  *
  21.  * @help
  22.  * Images must be named in sequence: Loading1, Loading2, etc.
  23.  *
  24.  * Set "Number of Images" to the total number of "Loading" images you've
  25.  * used (excluding the default).
  26.  *
  27.  * There are no plugin commands.
  28.  *
  29.  * This plugin is free to use under CC BY-SA 4.0, but please refer to the
  30.  * RPG Maker Times blogsite for other details.
  31.  *
  32.  */
  33.  
  34. (function() {
  35.  
  36.         var parameters = PluginManager.parameters('RandomLoadingImage');
  37.         var numberImages = Number(parameters['Number of Images']);
  38.  
  39.         // Doesn't seem to work properly aliased, so overwritten
  40.         SceneManager.initGraphics = function() {
  41.                 var randomImage = (Math.floor(Math.randomInt(numberImages) + 1));
  42.                 var type = this.preferableRendererType();
  43.                 Graphics.initialize(this._screenWidth, this._screenHeight, type);
  44.                 Graphics.boxWidth = this._boxWidth;
  45.                 Graphics.boxHeight = this._boxHeight;
  46.                 Graphics.setLoadingImage('img/system/Loading'+randomImage+'.png');
  47.                 if (Utils.isOptionValid('showfps')) { Graphics.showFps(); }
  48.                 if (type === 'webgl') { this.checkWebGL(); }
  49.         };
  50.  
  51. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement