| 赞 | 7 |
| VIP | |
| 好人卡 | |
| 积分 | 6 |
| 经验 | |
| 最后登录 | 2026-3-6 |
| 在线时间 | 165 小时 |
- 梦石
- 0
- 星屑
- 647
- 在线时间
- 165 小时
- 注册时间
- 2012-4-18
- 回帖
- 237
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 salvareless 于 2016-3-24 10:27 编辑
如题,自己改写了一个自用脚本,基本功能是在主菜单中加入一个能力选项,进去之后是一个Command菜单,目前已经实现改变单个Command选项的宽和高,但是不知道怎么控制Command选项里面的文字,它依旧是靠上方显示的,想法有两个:
1·让显示的字符串可以完全居中显示而不是水平方向居中了,但竖直方向依旧是靠上显示的。然后就是让显示的字符串具备换行的功能。
2·当然想要实现我想要的效果其实还可以用另一个方式,那就是为Command选项增加一个背景图片。大窗口的背景我倒是弄出来了,但是Command选项的背景是怎么也搞不定。
哪位大神路过给指点一下迷津呗~~~~~以上两个思路只要有能一个实现就OK
目前做到这个程度= =

代码如下:
[pre lang="javascript"]//=============================================================================
// Salvareless Ownuse System
// SOS_公共事件快捷操作功能.js
//=============================================================================
//帮助区段
//由于各种不会,所以代码写得超级乱。
//帮助区段END
//主菜单显示选项区段
// ======================================================================
// * Scene_Menu
// ======================================================================
Scene_Menu.prototype.caozuo_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
Scene_Menu.prototype.createCommandWindow = function() {
this.caozuo_createCommandWindow();
this._commandWindow.setHandler('caozuo', this.command_caozuo.bind(this));
};
Scene_Menu.prototype.command_caozuo = function() {
SceneManager.push(ThirdScene);
};
// ======================================================================
// * Window_MenuCommand
// ======================================================================
Window_MenuCommand.prototype.caozuo_addOriginalCommands = Window_MenuCommand.prototype.addOriginalCommands;
Window_MenuCommand.prototype.addOriginalCommands = function() {
this.caozuo_addOriginalCommands();
this.addCommand('能力', 'caozuo', this.areMainCommandsEnabled());
};
//=============================================================================
// ThirdScene.js
//=============================================================================
function LeftWindow(){
this.initialize.apply(this,arguments);
}
LeftWindow.prototype = Object.create(Window_Command.prototype);
LeftWindow.prototype.constructor = LeftWindow;
LeftWindow.prototype.initialize = function(x,y){
Window_Command.prototype.initialize.call(this, x, y);
};
LeftWindow.prototype.windowWidth = function(){
return 736;
};
LeftWindow.prototype.windowHeight = function() {
return 544;
};
LeftWindow.prototype.maxCols = function() {
return 3;
};
LeftWindow.prototype.itemHeight = function() {
return 100;//this.lineHeight();
};
LeftWindow.prototype.itemTextAlign = function() {
return 'center';
};
LeftWindow.prototype.makeCommandList = function(){
if ($gameSwitches.value(1) != true){
this.addCommand("LOCKDE</br>尚未解锁的能力","Dairy0",true);
} else {
this.addCommand("日记一","Dairy1",true);
}
this.addCommand("日记二","Dairy2",true);
this.addCommand("日记三","Dairy3",true);
this.addCommand("日记四","Dairy4",true);
};
function RightWindow(){
this.initialize.apply(this,arguments);
}
RightWindow.prototype = Object.create(Window_Selectable.prototype);
RightWindow.prototype.constructor = RightWindow;
RightWindow.prototype.initialize = function(x,y,width,height){
Window_Selectable.prototype.initialize.call(this,x,y,width,height);
};
function ThirdScene(){
this.initialize.apply(this,arguments);
}
ThirdScene.prototype = Object.create(Scene_MenuBase.prototype);
ThirdScene.prototype.constructor = ThirdScene;
ThirdScene.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
ThirdScene.prototype.createBackground = function(){
this._backgroundSprite = new Sprite();
this._backgroundSprite.bitmap =
ImageManager.loadPicture('Convey_7');
this.addChild(this._backgroundSprite);
return;
};
ThirdScene.prototype.create = function(){
Scene_MenuBase.prototype.create.call(this);
this._leftWindow = new LeftWindow(40,40);
this._leftWindow.setHandler("Dairy1",this.commandDairy1.bind(this));
this._leftWindow.setHandler("Dairy2",this.commandDairy1.bind(this));
this._leftWindow.setHandler("Dairy3",this.commandDairy1.bind(this));
this._leftWindow.setHandler("Dairy4",this.commandDairy1.bind(this));
this._leftWindow.setHandler('cancel', this.popScene.bind(this)); //返回用代码
this.addWindow(this._leftWindow);
};
//窗口透明化
var _ThirdScene_create = ThirdScene.prototype.create;
ThirdScene.prototype.create = function(){
_ThirdScene_create.call(this);
this._leftWindow.opacity = 0;
};
//窗口透明化end
ThirdScene.prototype.commandDairy1 = function(){
this._leftWindow.activate();
switch (this._leftWindow.currentSymbol()) {
case 'Dairy1':
SceneManager.goto(Scene_Map);
$gameTemp.reserveCommonEvent(1);
break;
case 'Dairy2':
SceneManager.goto(Scene_Map);
$gameTemp.reserveCommonEvent(1);
break;
case 'Dairy3':
SceneManager.goto(Scene_Map);
$gameTemp.reserveCommonEvent(1);
break;
case 'Dairy4':
SceneManager.goto(Scene_Map);
$gameTemp.reserveCommonEvent(1);
break;
}
};[/pre] |
|