加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
代码很简单,就是在窗口中显示一个变量的值和主角的HP值:
function Window_Testing(){ this.initialize.apply(this,arguments); } Window_Testing.prototype=Object.create(Window_Selectable.prototype); Window_Testing.prototype.initialize=function(x,y,width,height){ Window_Selectable.prototype.initialize.call(this,x,y,width,height); this.drawSomeText(); } Window_Testing.prototype.drawSomeText=function(){ var actor=$gameActors.actor(1); var textW = 360; var textH = 0; this.contents.clear(); this.drawText("持有的生命之石:"+$gameVariables.value(11)+"/10", 0, textH, textW, 'right'); textH += this.lineHeight(); this.drawText(actor._name+"的生命值为:"+actor.hp+"/"+actor.mhp, 0, textH, textW, 'right'); } function Scene_Testing(){ this.initialize.apply(this,arguments); } Scene_Testing.prototype=Object.create(Scene_MenuBase.prototype); Scene_Testing.prototype.initialize=function(){ Scene_MenuBase.prototype.initialize.call(this); }; Scene_Testing.prototype.create=function(){ Scene_MenuBase.prototype.create.call(this); this._commandWindow=new Window_Testing(0,480,400,110); this.addWindow(this._commandWindow); }; Scene_Testing.prototype.update=function(){ /*这里该怎么写才能让该窗口在游戏过程中一直显示同时不会影响游戏的进程*/ SceneManager.goto(Scene_Map); };
function Window_Testing(){
this.initialize.apply(this,arguments);
}
Window_Testing.prototype=Object.create(Window_Selectable.prototype);
Window_Testing.prototype.initialize=function(x,y,width,height){
Window_Selectable.prototype.initialize.call(this,x,y,width,height);
this.drawSomeText();
}
Window_Testing.prototype.drawSomeText=function(){
var actor=$gameActors.actor(1);
var textW = 360;
var textH = 0;
this.contents.clear();
this.drawText("持有的生命之石:"+$gameVariables.value(11)+"/10", 0, textH, textW, 'right');
textH += this.lineHeight();
this.drawText(actor._name+"的生命值为:"+actor.hp+"/"+actor.mhp, 0, textH, textW, 'right');
}
function Scene_Testing(){
this.initialize.apply(this,arguments);
}
Scene_Testing.prototype=Object.create(Scene_MenuBase.prototype);
Scene_Testing.prototype.initialize=function(){
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_Testing.prototype.create=function(){
Scene_MenuBase.prototype.create.call(this);
this._commandWindow=new Window_Testing(0,480,400,110);
this.addWindow(this._commandWindow);
};
Scene_Testing.prototype.update=function(){
/*这里该怎么写才能让该窗口在游戏过程中一直显示同时不会影响游戏的进程*/
SceneManager.goto(Scene_Map);
};
在事件页调用该脚本
窗口会不停闪烁。请教高手们,该怎样写才能实现该窗口在游戏过程中一直显示同时不会影响游戏的进程,谢谢。 |