//####################################################
//# Default Scene_Title #
//# Warning: #
//# This class is vital. #
//# You can Clear all content in this script #
//# and make empty all function #
//# But you cannot remove the file. #
//# Mire depends on it. #
//#--------------------------------------------------#
//# By Mire Dev #
//####################################################
//Include library
#include "Bitmap.js" //Bitmap Class
#include "Window_Base.js" //Window Class
#include "Screen.js" //Screen Class
#include "Scene_Manager.js" //Scene Manager
#include "Audio.js" //System Audio
//Public Variables
var selected_item = 0; //Selected item on window
var item = 2; //Max Item on the list
//Constructor
function Scene_Title()
{
this.bitmap = new Bitmap();
this.window = new Window_Base();
this.screen = new screen();
this.scene = new Scene_Manager();
this.audio = new Audio();
};
//Initialize the Scene
Scene_Title.prototype.Initialize = function()
{
//Metodo Initialize
var b = new Bitmap();
//Load Background Image
b.Cache(0,"data\\GUI\\Title\\Mire.png");
//Load System Skin
this.window.Cache("System01");
//Creating Window Selectable
this.window.Add_SelectableItem(0,0,"New Game");
this.window.Add_SelectableItem(0,1,"Continue");
this.window.Add_SelectableItem(0,2,"Exit");
};
//Scene rendering Update
Scene_Title.prototype.Update = function()
{
//Draw Background
this.bitmap.Draw(0,0,0);
//Setup variabile padding
var wx = (this.screen.GetWidth() - 250) / 2;
var wy = this.screen.GetHeight() / 2;
var ww = 250 + (this.window.StandardPadding() * 2);
var wh = 96 + (this.window.StandardPadding() * 2);
//Draw Selectable Window
this.window.Draw_SelectableWindow(wx,wy,ww,wh,0,selected_item);
//On Key Down pressed
if(key_down == "down")
{
//Cursor Sound Effect
this.audio.PlaySE("cursor");
//if Selected Item ID are same to full item ID
if(selected_item == item)
{
selected_item = 0; //Back to First
}else
{
selected_item++; //Increment ( Slide down )
}
}
//On Up Arrow Pressed
if(key_down == "up")
{
//Cursor Sound Effect
this.audio.PlaySE("cursor");
//If Selected Item are same to 0 ID
if(selected_item == 0)
{
selected_item = item; //Goto Last Item
}else
{
selected_item--; //Decrement ( Slide Up )
}
}
//On Key Enter pressed Goto Game
if(key_down == "enter")
{
if(selected_item == 0) //Selected New Game
{
this.audio.PlaySE("accept");
this.scene.Call("game");
}
if(selected_item == 1) //Continue
{
//this.scene.Call("load");
}
if(selected_item == 2) //Exit
{
//this.scene.Call("new");
}
}
}