Skip to content

Instantly share code, notes, and snippets.

@TakkunMaker
Created February 20, 2016 20:40
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 TakkunMaker/0f5b82e3eb83fec032b6 to your computer and use it in GitHub Desktop.
Save TakkunMaker/0f5b82e3eb83fec032b6 to your computer and use it in GitHub Desktop.
//=============================================================================
// TK - Titlescreen
//-----------------------------------------------------------------------------
// The scene class of the title screen.
//=============================================================================
//-----------------------------------------------------------------------------
// Configurations
//-----------------------------------------------------------------------------
/*:
* @plugindesc Este plugin permite modificações na Tela Título via Imagens.
* @author Takkun
*
* @param Title_Logo
* @desc Imagem da Logotipo da Tela Título.
* @default Logo
*
* @param NewGame
* @desc Imagem do comando Novo Jogo da Tela Título.
* @default NewGame
*
* @param Continue
* @desc Imagem do comando Continuar da Tela Título.
* @default Continue
*
* @param Options
* @desc Imagem do comando Opções da Tela Título.
* @default Options
*
* @param Exit
* @desc Imagem do comando Sair da Tela Título.
* @default Exit
*-----------------------------------------------------------------------------
* @help
* Todas as imagens devem estar na Pasta System do seu jogo, nomeadas assim
* como foi definido no Script.
*
* Novas versões podem ser lançadas corrigindo, ou adicionando coisas no
* futuro.
*
* Modificações podem ser feitas e postadas, desde que os devidos créditos
* sejam mantidos.
*
* Agradeço a King Gerar e SoulPour777 pela base.
*
* Uso comercial e não-comercial permitido.
*/
//=============================================================================
(function() {
var parameters = PluginManager.parameters('TK - Titlescreen');
var Title_Logo = parameters['Title_Logo'];
var NewGame = parameters['NewGame'];
var Continue = parameters['Continue'];
var Options = parameters['Options'];
var Exit = parameters['Exit'];
//-----------------------------------------------------------------------------
// Scene_Title
//-----------------------------------------------------------------------------
var TKTitleImages = [NewGame, Continue, Options, Exit]
var TKTitlescreen_create = Scene_Title.prototype.create
var TKTitlescreen_update = Scene_Title.prototype.update
Scene_Title.prototype.create = function() {
TKTitlescreen_create.apply(this);
this.createCommandImages();
this.createLogotipe();
};
Scene_Title.prototype.createCommandImages = function(){
this._imageCommands = new Sprite();
this.addChild(this._imageCommands);
}
Scene_Title.prototype.createLogotipe = function(){
this._logotipe = new Sprite();
this._logotipe.bitmap = ImageManager.loadSystem(Title_Logo);
this.addChild(this._logotipe);
}
Scene_Title.prototype.update = function() {
TKTitlescreen_update.apply(this);
this._imageCommands.bitmap = ImageManager.loadSystem(TKTitleImages[this._commandWindow._index])
};
Scene_Title.prototype.createCommandWindow = function() {
this._commandWindow = new Window_TitleCommand();
this._commandWindow.visible = false;
this._commandWindow.x = Graphics.width * 2;
this._commandWindow.y = Graphics.height * 2;
this._commandWindow.setHandler('newGame', this.commandNewGame.bind(this));
this._commandWindow.setHandler('continue', this.commandContinue.bind(this));
this._commandWindow.setHandler('options', this.commandOptions.bind(this));
this._commandWindow.setHandler('exit', this.commandExit.bind(this));
this.addWindow(this._commandWindow);
};
Scene_Title.prototype.commandExit = function() {
this._commandWindow.close();
this.fadeOutAll();
SceneManager.exit();
};
//-----------------------------------------------------------------------------
// Window_TitleCommand
//-----------------------------------------------------------------------------
Window_TitleCommand.prototype.makeCommandList = function() {
this.addCommand(TextManager.newGame, 'newGame');
this.addCommand(TextManager.continue_, 'continue', this.isContinueEnabled());
this.addCommand(TextManager.options, 'options');
this.addCommand("", 'exit');
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment