Possibilità di inserire plugin propri?
Compatibilità con plugin già esistenti?
Ecma 5 o 6?
Scusa se queste domande sono già state fatte, non ho avuto tempo per seguire tutta la discussione
E' possibile scrivere propri plug-in.
Compatibilità con altri plugin non è possibile, perché e comunque interpretato dal motore e richiede determinati fattori per funzionare.
Esempio le API a cui fà riferimento il javascript al motore.
Ecma 6 ma con alcune limitazioni
Non è possibile usare:
Generatori,
Unicode,
Moduli,
Weakmap e Weakse,
Promises e chiamate di coda.
Esempio di script:
Questo è lo script del TitleScreen,
da qui puoi notare com'è strutturato e le sue funzionalità
//#################################################### //# 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 #include "Keyboard.js" //Keyboard //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(); this.keyboard = new Keyboard(); }; //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_Title.prototype.Test = function() { //Draw Background this.bitmap.Draw(0,0,0); }; //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(this.keyboard.GetKey() == "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(this.keyboard.GetKey() == "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(this.keyboard.GetKey() == "enter") { if(selected_item == 0) //Selected New Game { this.audio.PlaySE("accept"); this.scene.StartGame(); } if(selected_item == 1) //Continue { this.scene.Call("Prova"); } if(selected_item == 2) //Exit { //this.scene.Call("new"); } } }
Modificato da Thejuster, 29 March 2021 - 07:50 AM.