赞 | 136 |
VIP | 0 |
好人卡 | 0 |
积分 | 281 |
经验 | 0 |
最后登录 | 2024-11-25 |
在线时间 | 1416 小时 |
Lv5.捕梦者
- 梦石
- 16
- 星屑
- 12090
- 在线时间
- 1416 小时
- 注册时间
- 2020-3-21
- 帖子
- 365
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 仇九 于 2020-7-14 11:32 编辑
我照着https://rpg.blue/thread-409713-1-2.html中的那个时间hub插件写了一个脚本,想显示两张图片和一行文字,但是我载入脚本并执行$gamecut.refresh()后只显示了两张图片,没有文字(在(200,200)处显示 我是文字 )。求大佬指教!
已经在插件管理器中开启了这个脚本,并且图片已经放入相应文件夹,无论是载入游戏还是执行$gamecut.refresh(),都没有error出现。
Scene_Base.prototype.createHudField = function() {
this._hudField = new Sprite();
this._hudField.z = 10;
this.addChild(this._hudField);
};
Scene_Base.prototype.sortMz = function() {
this._hudField.children.sort(function(a, b){return a.mz-b.mz});
};
var SJ = Scene_Map.prototype.createSpriteset;
Scene_Map.prototype.createSpriteset = function() {
SJ.call(this);
this.createHudField();
this.createTimeSystemHud();
this.sortMz();
};
Scene_Map.prototype.createTimeSystemHud = function() {
this.sprite_time_engine = new Datashow();
this.sprite_time_engine.mz = 120;
this._hudField.addChild(this.sprite_time_engine);
};
ImageManager.load_MapUi = function(filename) {return this.loadBitmap('img/Map__ui/', filename, 0, true);}
function Datashow() {
this.initialize.apply(this, arguments); //执行Datashow.prototype.initialize
};
Datashow.prototype = Object.create(Sprite.prototype); //在datashou里创建精灵
Datashow.prototype.constructor = Datashow; //将datashow自己返回为数组Datashow
Datashow.prototype.initialize = function() {
Sprite.prototype.initialize.call(this); //将此函数内容带入Sprite并执行
this.loadImages();
this.create_sprites();
};
Datashow.prototype.refresh = function() { //将此函数内容带入Sprite并执行
this.loadImages();
this.create_sprites();
};
Datashow.prototype.loadImages = function() {
Sprite.prototype.initialize.call(this); //将此函数内容带入Sprite并执行
this._hg1_img = ImageManager.load_MapUi('时间系统框-框');
this._hg2_img = ImageManager.load_MapUi('时间系统框-框(mog)');
};
Datashow.prototype.create_sprites = function() {
this.create_dayweek();
this.create_point();
this.create_layout();
};
Datashow.prototype.create_layout = function() {
this._layout = new Sprite(this._hg1_img);
this._layout.x = 100;
this._layout.y = 100;
this._layout.visible = true;
this.addChild(this._layout);
};
Datashow.prototype.create_point = function() {
this._point = new Sprite(this._hg2_img);
this._point.x = 100;
this._point.y = 100;
this._point.visible = true;
this.addChild(this._point);
};
Datashow.prototype.update = function() {
Sprite.prototype.update.call(this);
this._point.rotation = 0;
this._layout.rotation = 0;
this.opacity == 255;
};
Datashow.prototype.create_dayweek = function() {
this._dayweek = new Sprite(new Bitmap(90,50));
this._dayweek.x = 200;
this._dayweek.y = 200;
this._dayweek.bitmap.fontSize = 50;
this._dayweek.bitmap.fontItalic = true;
this._dayweek.visible = true;
this.addChild(this._dayweek);
this.refresh_dayweek;
};
Datashow.prototype.refresh_dayweek = function() {
this._dayweek.bitmap.clear();
this._dayweek.bitmap.drawText(5555555,50,50,90,32,"center");
}; |
|