| 赞 | 58 |
| VIP | |
| 好人卡 | |
| 积分 | 122 |
| 经验 | |
| 最后登录 | 2026-11-13 |
| 在线时间 | 657 小时 |
- 梦石
- 8
- 星屑
- 4178
- 在线时间
- 657 小时
- 注册时间
- 2021-8-13
- 回帖
- 629
 
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 asukalin 于 2021-9-18 03:52 编辑
之前说过,我想在游戏里做一个事项清单:
https://rpg.blue/thread-487126-1-1.html
现在参考了教学贴
https://rpg.blue/thread-386506-1-1.html
里的方法,做成了弹窗
但这个弹窗里的“清单”内容,其实是直接写在脚本文件里的……
- 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);
- }
-
- 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(144, 96, 528, 432);
- this.addWindow(this._commandWindow);
- }
- Scene_Testing.prototype.update = function() {
- if (Input.isTriggered('escape') || Input.isTriggered('cancel') || Input.isTriggered('ok') || TouchInput.isTriggered()) {
- this._commandWindow.hide();
- SceneManager.goto(Scene_Map);
- }
- };
- 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 textW = 488;
- var textH = 0;
- this.drawText("我必须要完成的事", 0, textH, textW, 'center');
- textH += this.lineHeight();
- this.drawText(" ", 0, textH, textW, 'left');
- textH += this.lineHeight();
- this.drawText(" 1. 第一项", 0, textH, textW, 'left');
- textH += this.lineHeight();
- this.drawText(" 2. 第二项", 0, textH, textW, 'left');
- textH += this.lineHeight();
- this.drawText(" 3. 第三项", 0, textH, textW, 'left');
- textH += this.lineHeight();
- this.drawText(" 4. 第四项", 0, textH, textW, 'left');
- textH += this.lineHeight();
- this.drawText(" 5. 第五项", 0, textH, textW, 'left');
- textH += this.lineHeight();
- this.drawText(" 6. 第六项", 0, textH, textW, 'left');
- textH += this.lineHeight();
- this.drawText(" 7. 第七项", 0, textH, textW, 'left');
- textH += this.lineHeight();
- this.drawText(" ", 0, textH, textW, 'left');
- textH += this.lineHeight();
- this.drawText("试着赶在七天之内,全部涂红吧", 0, textH, textW, 'right');
- }
复制代码
就像教学贴里做的那样。
我不懂JavaScript,只能在原贴的代码上小改几个地方。
我想实现的效果是:
1. 能够像在事件编辑器里面那样随意编辑文本的样式,例如,最后一行单独让“涂红”二字变红或变大。如果还能插入emo图标就更棒了。
2. 随着剧情发展、“任务完成”,列表的文本内容可以变化。
听起来,似乎很基础吧?……
可惜我是萌新,又不懂JavaScript,现在就已经不知道下一步该怎么走了。 |
|