//----------------------------------------------------------// Animated Title Cirno.js//----------------------------------------------------------// FUSAO ENTRE ANIMATED TITLE REIMU + PH_Video_Title/*: * @plugindesc Makes your boring title screen to an animated one! * @author Soulpour777 and PrimeHover * * @help//----------------------------------------------------------// Animated Title Cirno.js// Author: Soulpour777//---------------------------------------------------------- * Plugin Help: * Mouse and Touch Pad Settings: * Take note that when you change the locations of your command picture's x and y, * you might want to consider changing some of the variables that can be found * in your plugin manager, because most of them are at default location where * your commands are. That means if you changed the position of your commands, * change the touchpad settings as well. * Change the following variables if command position is changed: * TouchPadXMin, TouchPadXMax, TouchPadYMin01, TouchPadXMax01, * TouchPadYMin02, TouchPadXMax02, TouchPadYMin03, TouchPadXMax03. * Each TouchPadYMin and Max values are determined which command * is used. If you are using separate images, bulk them into one just like * how the default example was made. * Place your images under the img/titles1 folder. * @param TitleCommandImagesReimu * @desc The list contains the names of the images of your title command. * @default Menu01, Menu02, Menu03 * * @param TitleCommandsX * @desc The x position of your title command images. * @default 313 * * @param TitleCommandsY * @desc The x position of your title command images. * @default 380 * * @param PortraitTitle * @desc The portrait image you use floating on the screen. (without "" marks) * @default Reimu * * @param PortraitImageX * @desc The x position of the portrait image you use floating on the screen. * @default 400 * * @param PortraitImageY * @desc The y position of the portrait image you use floating on the screen. * @default 200 * * @param PortraitsOpacity * @desc Opacity of the Portraits you are using. * @default 255 * * @param PortraitMovementDivider * @desc How many milliseconds do you want to cut off animating the portrait everytime? * @default 1000 * * @param TitleBackSprite * @desc Opacity of the Portraits you are using. * @default TitleBack * * @param CircleObj * @desc The Circle Symbol you are using (without "" marks). * @default CircleSymbol * * @param CircleX * @desc The x position of the circle rotating on your title screen. * @default 620 * * @param CircleY * @desc The y position of the circle rotating on your title screen. * @default 312 * * @param CircleAnchorX * @desc The origin point of the sprite in x. (ex: (0,0) to (1,1).) * @default 0.5 * * @param CircleAnchorY * @desc The origin point of the sprite in y. (ex: (0,0) to (1,1).) * @default 0.5 * * @param CircleOpacity * @desc The opacity of your circle symbol rotating on your title screen. * @default 255 * * @param CircleRotation * @desc The rotation speed of the circle object rotating on your title screen. * @default 0.005 * * @param ContinueDisabled * @desc The image displayed if there's no save data and its under continue mark. * @default Menu02_B * * @param CursorDivider * @desc How many milliseconds do you want to cut off animating the cursor everytime? * @default 200 * * @param TouchPadXMin * @desc The touchpad default x position minimum value range. * @default 20 * * @param TouchPadXMax * @desc The touchpad default y position maximum value range. * @default 180 * * @param TouchPadYMin01 * @desc The touchpad default y position minimum value range (First Option). * @default 400 * * @param TouchPadYMax01 * @desc The touchpad default y position maximum value range (First Option). * @default 420 * * @param TouchPadYMin02 * @desc The touchpad default y position minimum value range (Second Option). * @default 440 * * @param TouchPadYMax02 * @desc The touchpad default y position maximum value range (Second Option). * @default 480 * * @param TouchPadYMin03 * @desc The touchpad default y position minimum value range (Third Option). * @default 470 * * @param TouchPadYMax03 * @desc The touchpad default y position maximum value range (Third Option). * @default 520 * */var Imported = Imported || {};Imported.AnimatedTitleReimu = true;var Soulpour777 = Soulpour777 || {};Soulpour777.AnimatedTitleReimu = {};Soulpour777.AnimatedTitleReimu.params = PluginManager.parameters('TittlePicVideoSPHaRK'); // Touchpad Settingsvar touchpad_xmin = Number(Soulpour777.AnimatedTitleReimu.params['TouchPadXMin'] || 298); var touchpad_xmax = Number(Soulpour777.AnimatedTitleReimu.params['TouchPadXMax'] || 511); var touchpad_ymin_a = Number(Soulpour777.AnimatedTitleReimu.params['TouchPadYMin01'] || 375); var touchpad_ymax_a = Number(Soulpour777.AnimatedTitleReimu.params['TouchPadYMax01'] || 412); var touchpad_ymin_b = Number(Soulpour777.AnimatedTitleReimu.params['TouchPadYMin02'] || 413); var touchpad_ymax_b = Number(Soulpour777.AnimatedTitleReimu.params['TouchPadYMax02'] || 450); var touchpad_ymin_c = Number(Soulpour777.AnimatedTitleReimu.params['TouchPadYMin03'] || 451); var touchpad_ymax_c = Number(Soulpour777.AnimatedTitleReimu.params['TouchPadYMax03'] || 478); //Video Variables Settings var videoMuted = 0 var videoLoop = 0 var videoWidth = 1040 //830 var videoHeight = 640 //470 var videoX = -15 var videoY = 0// Portrait Variablesvar portraits_opacity = Number(Soulpour777.AnimatedTitleReimu.params['PortraitsOpacity'] || 255);var portrait_images_list = String(Soulpour777.AnimatedTitleReimu.params['PortraitTitle']|| "Reimu");var portrait_image_x = Number(Soulpour777.AnimatedTitleReimu.params['PortraitImageX'] || 400);var portrait_image_y = Number(Soulpour777.AnimatedTitleReimu.params['PortraitImageY'] || 200);var portrait_image_mov = Number(Soulpour777.AnimatedTitleReimu.params['PortraitMovementDivider'] || 1000);//Circle Variablesvar circle_sym = String(Soulpour777.AnimatedTitleReimu.params['CircleObj']|| "CircleSymbol");var circle_sym_x = Number(Soulpour777.AnimatedTitleReimu.params['CircleX'] || 620);var circle_sym_y = Number(Soulpour777.AnimatedTitleReimu.params['CircleY'] || 312);var circle_sym_anchor_x = Number(Soulpour777.AnimatedTitleReimu.params['CircleAnchorX'] || 0.5);var circle_sym_anchor_y = Number(Soulpour777.AnimatedTitleReimu.params['CircleAnchorY'] || 0.5);var circle_sym_opacity = Number(Soulpour777.AnimatedTitleReimu.params['CircleOpacity'] || 255);var circle_sym_rotation = Number(Soulpour777.AnimatedTitleReimu.params['CircleRotation'] || 0.005);// Title Variablesvar title_back_sprite = String(Soulpour777.AnimatedTitleReimu.params['TitleBackSprite']|| "titleBack");var title_commands_x = Number(Soulpour777.AnimatedTitleReimu.params['TitleCommandsX'] || 313);var title_commands_y = Number(Soulpour777.AnimatedTitleReimu.params['TitleCommandsY'] || 380);var continue_is_disabled = String(Soulpour777.AnimatedTitleReimu.params['Menu02_B'] || "Menu02_B");var cursor = String(Soulpour777.AnimatedTitleReimu.params['IndicatorCursor'] || "Indicator_Cursor");var cursor_divider = Number(Soulpour777.AnimatedTitleReimu.params['CursorDivider'] || 200);// Alias Methodsvar alias_scene_title_prototype_create = Scene_Title.prototype.create;var alias_scene_title_prototype_update = Scene_Title.prototype.update;// Command Image Variablesvar reimu_command_images = Soulpour777.AnimatedTitleReimu.params['TitleCommandImagesReimu'].split(/\s*,\s*/).filter(function(value) { return !!value; });var titleImage = String(Soulpour777.AnimatedTitleReimu.params['TitleLogo'] || "Title_Logo");// Instance VariablesScene_Title.prototype.circle_object;Scene_Title.prototype.titleScreenCommandReimu;Scene_Title.prototype.command_option_sprite;Scene_Title.prototype.command_continue_sprite;Scene_Title.prototype.cursor_image;Scene_Title.prototype._gameTitleImage;Scene_Title.prototype.particle_object;// Disable Drawing of Title Parametervar disableDrawingTitle = String(Soulpour777.AnimatedTitleReimu.params['DisableDrawingOfTitle'] || "true"); /* Video Title Class */ var PH_VideoTitle = null; function VideoTitle() { this.name = 'EdGdS.webm'; /* Creating video tag */ this._video = document.createElement('video'); this._video.id = 'VideoTitle_' + this.name.replace(/[^A-Z0-9]+/ig, "_"); this._video.src = 'movies/' + this.name; this._video.style.width = 0; this._video.style.height = 0; this._video.autoPlay = false; /* Control Options */ this.setControlOptions(); /* Appending the video at the body tag */ document.body.appendChild(this._video); /* Starts video and creates the texture */ this.setVideoTexture(); } VideoTitle.prototype.constructor = VideoTitle; VideoTitle.prototype.setControlOptions = function() { if (videoLoop == 1) { this._video.loop = true; } else { this._video.loop = false; } if (videoMuted == 1) { this._video.muted = true; } else { this._video.muted = false; } }; VideoTitle.prototype.setVideoTexture = function() { this._texture = PIXI.VideoTexture.textureFromVideo(this._video); this._spriteVideo = new PIXI.Sprite(this._texture); this._spriteVideo.width = videoWidth; this._spriteVideo.height = videoHeight; this._spriteVideo.x = videoX; this._spriteVideo.y = videoY; }; VideoTitle.prototype.pauseVideo = function() { this._video.pause(); }; VideoTitle.prototype.playVideo = function() { this._video.play(); };Scene_Title.prototype.create = function() { /* Prevent the video to be duplicated */ if (PH_VideoTitle === null) { PH_VideoTitle = new VideoTitle(); } this.videoTitle = PH_VideoTitle; this.videoTitle.playVideo(); this.addChild(this.videoTitle._spriteVideo); //call original method alias_scene_title_prototype_create.call(this); this.portrait_images = null; this.create_portrait(); this.create_titleDrawing(); this.create_circle_object(); this.createCommandImages(); this.create_indicator();};Scene_Title.prototype.start = function() { Scene_Base.prototype.start.call(this); SceneManager.clearStack(); if (videoMuted == 1) { this.playTitleMusic(); } this.startFadeIn(this.fadeSpeed(), false); }; Scene_Title.prototype.terminate = function() { Scene_Base.prototype.terminate.call(this); this.videoTitle.pauseVideo(); SceneManager.snapForBackground(); };Scene_Title.prototype.create_portrait = function() { this.portrait_images = new Sprite(); this.portrait_images.bitmap = ImageManager.loadTitle1(portrait_images_list); this.portrait_images.opacity = portraits_opacity; this.portrait_images.x = portrait_image_x; this.portrait_images.y = portrait_image_y; this.portrait_images.name = portrait_images_list; this.addChildAt(this.portrait_images, 4); } Scene_Title.prototype.createForeground = function() { this._gameTitleSprite = new Sprite(new Bitmap(Graphics.width, Graphics.height)); this.addChild(this._gameTitleSprite); };Scene_Title.prototype.createBackground = function() { this._backSprite1 = new Sprite(ImageManager.loadTitle1(title_back_sprite)); this._backSprite2 = new Sprite(ImageManager.loadTitle1(title_back_sprite)); this.addChild(this._backSprite1); this.addChild(this._backSprite2); }; Scene_Title.prototype.update_portrait_image_animation = function() { var x = new Date().getTime() / portrait_image_mov; this.portrait_images.y = Graphics.height / 2 - this.portrait_images.height / 4 + Math.cos(parseFloat(x)) * 70; }Scene_Title.prototype.update = function() { alias_scene_title_prototype_update.call(this); this.rotate_circle_object(); this.update_portrait_image_animation(); this.portrait_images.bitmap = ImageManager.loadTitle1(portrait_images_list); if (DataManager.isAnySavefileExists()) { this.command_continue_sprite.bitmap = ImageManager.loadTitle1(reimu_command_images[this._commandWindow._index]); } else { if (this._commandWindow._index == 1) { this.command_continue_sprite.bitmap = ImageManager.loadTitle1(continue_is_disabled); } else if (this._commandWindow._index == 0){ this.command_continue_sprite.bitmap = ImageManager.loadTitle1('Menu01_B'); } else { this.command_continue_sprite.bitmap = ImageManager.loadTitle1('Menu03_B'); } } this.animate_cursor(); this.update_cursor_location(); this.update_pad_android_tab_cursor();};Scene_Title.prototype.create_circle_object = function() { this.circle_object = new Sprite(ImageManager.loadTitle1(circle_sym)); this.circle_object.x = circle_sym_x; this.circle_object.y = circle_sym_y; this.circle_object.anchor.x = circle_sym_anchor_x; this.circle_object.anchor.y = circle_sym_anchor_y; this.circle_object.opacity = circle_sym_opacity; this.addChildAt(this.circle_object, 3);}Scene_Title.prototype.rotate_circle_object = function() { this.circle_object.rotation += circle_sym_rotation; this.circle_object.opacity += 3;}var alias_soul_scene_title_prototype_createCommandWindow = Scene_Title.prototype.createCommandWindow;Scene_Title.prototype.createCommandWindow = function() { alias_soul_scene_title_prototype_createCommandWindow.call(this); this._commandWindow.hide(); this._commandWindow.x = -Graphics.boxWidth; this._commandWindow.y = -Graphics.boxHeight; this._commandWindow.visible = false;};Scene_Title.prototype.createCommandImages = function() { this.command_continue_sprite = new Sprite(); this.command_continue_sprite.bitmap = ImageManager.loadTitle1(reimu_command_images[1]); this.command_continue_sprite.x = title_commands_x; this.command_continue_sprite.y = title_commands_y; this.addChildAt(this.command_continue_sprite, 6);}Scene_Title.prototype.create_indicator = function() { this.cursor_image = new Sprite(); this.cursor_image.bitmap = ImageManager.loadTitle1(cursor); this.cursor_image.x = this.command_continue_sprite.x - 45; this.cursor_image.y = title_commands_x; this.addChildAt(this.cursor_image, 6);}Scene_Title.prototype.animate_cursor = function() { var x = new Date().getTime() / cursor_divider; this.cursor_image.x = this.command_continue_sprite.x - 23 - this.cursor_image.height / 4 + Math.cos(parseFloat(x)) * 2; }Scene_Title.prototype.update_cursor_location = function() { if (this._commandWindow._index == 0) { this.cursor_image.y = this.command_continue_sprite.y; } if (this._commandWindow._index == 1) { this.cursor_image.y = this.command_continue_sprite.y + 40; } if (this._commandWindow._index == 2) { this.cursor_image.y = this.command_continue_sprite.y + 80; } }Scene_Title.prototype.create_titleDrawing = function() { this._gameTitleImage = new Sprite(); this._gameTitleImage.bitmap = ImageManager.loadTitle1(titleImage); this.addChildAt(this._gameTitleImage, 5);}Scene_Title.prototype.update_pad_android_tab_cursor = function() { if(TouchInput.isTriggered() && TouchInput._x > this.command_continue_sprite.x - touchpad_xmin && TouchInput._x < this.command_continue_sprite.x + touchpad_xmax && TouchInput._y > touchpad_ymin_a && TouchInput._y < touchpad_ymax_a) { this._commandWindow._index = 0; SoundManager.playCursor(); this._commandWindow.processOk(); } if(TouchInput.isTriggered() && TouchInput._x > this.command_continue_sprite.x - touchpad_xmin && TouchInput._x < this.command_continue_sprite.x + touchpad_xmax && TouchInput._y > touchpad_ymin_b && TouchInput._y < touchpad_ymax_ { this._commandWindow._index = 1; SoundManager.playCursor(); this._commandWindow.processOk(); } if(TouchInput.isTriggered() && TouchInput._x > this.command_continue_sprite.x - touchpad_xmin && TouchInput._x < this.command_continue_sprite.x + touchpad_xmax && TouchInput._y > touchpad_ymin_c && TouchInput._y < touchpad_ymax_c) { this._commandWindow._index = 2; SoundManager.playCursor(); this._commandWindow.processOk(); } }