random title display on start

● ARCHIVED · READ-ONLY
Started by WorldWakeSTU 1 posts View original ↗
  1. TitleScreenRandomImgSelector version 2.0
    WorldWakeSTU

    Introduction
    This script is for setting the title screen background to a random image of a selected group when the game starts.

    Features
    displays images from an array at random

    Screenshots
    currently no screenshots are available.

    (this only changes the title background so showing it do that is a little hard for me.)

    How to Use
    under titleScreens in the plugin manager and the names of the images like so:

    Castle,DemonCastle,Crystal

    Demo
    currently no demo available.

    Script

    Spoiler
    /****************************************
     TitleScreenRandomImgSelector_v2.js
    ****************************************/

    /*:
     * @plugindesc Displays a random background image for the title screen.
     * @author WorldWakeSTU
     *
     * @param TitleScreens
     * @desc The number of images being used for random selection on the title scene.
     * Default: DemonCastle,Castle,Crystal
     * @default DemonCastle,Castle,Crystal
     *
     *@help
     *-------------------------------------------------------------------
     * Free for non commercial and non-commercial use.
     * Version 2.0
     *-------------------------------------------------------------------
     *
     * --------------------------------------------------------------------------------
     * Required Files
     * --------------------------------------------------------------------------------
     * image name in array with no spaceing or ""
     *
     * --------------------------------------------------------------------------------
     * Version History
     * --------------------------------------------------------------------------------
     * 2.0 - TitleScreenRandomImgSelector_v2
     * -- changed how the images are obtained. * 1.0 - TitleScreenRandomImgSelector
     *//*
     *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     *|                                    |
     *|        complete plugin    12/1/2015    |
     *|                                    |
     *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */


                

     /*******************************************************************************
     *        WorldWakeSTU personal patch
     *******************************************************************************/
    (function() {
        var parameters = PluginManager.parameters('TitleScreenRandomImgSelector_v2');
        var selectedImageArray = parameters['TitleScreens'].split(/\s*,\s*/) || ['Castle','DemonCastle','Crystal'];
        console.log(selectedImageArray);
            Scene_Title.prototype.createBackground = function() {
                this._backSprite1 = new Sprite(ImageManager.loadTitle1(selectedImageArray[Math.randomInt(selectedImageArray.length)]));
                this._backSprite2 = new Sprite(ImageManager.loadTitle2($dataSystem.title2Name));
                this.addChild(this._backSprite1);
                this.addChild(this._backSprite2);
            }
    })();