| 赞 | 2  | 
 
| VIP | 0 | 
 
| 好人卡 | 0 | 
 
| 积分 | 1 | 
 
| 经验 | 0 | 
 
| 最后登录 | 2022-5-12 | 
 
| 在线时间 | 20 小时 | 
 
 
 
 
 
Lv1.梦旅人 
	- 梦石
 - 0 
 
        - 星屑
 - 102 
 
        - 在线时间
 - 20 小时
 
        - 注册时间
 - 2018-3-22
 
        - 帖子
 - 16
 
 
 
 | 
	
10星屑 
 本帖最后由 郭小受 于 2020-2-8 22:12 编辑  
 
小女最近初学插件,学习了如何制造窗口,按照他的讲解,成功在窗口显示了文字,然后突发奇想,想在窗口上显示图片。我查阅帮助,在bitmap里面看到了blt方法,但是使用了以后并没有显示图片,是我代码写错了吗?望大佬指点,小女感激不尽。 
只显示了窗口: 
 
 
代码如下(我不会插入代码) 
/*: 
 @author guo 
 @plugindesc 窗口示例 
 @help  
 
 
*/ 
function Window_MapStatus() { 
    this.initialize.apply(this, arguments) 
} 
Window_MapStatus.prototype = Object.create(Window_Base.prototype); 
Window_MapStatus.prototype.initialize = function (x, y, width, height) { 
    Window_Base.prototype.initialize.call(this, x, y, width, height); 
        this._timeBitmap = ImageManager.loadHitMouse("time_roller"); 
        this.refresh(); 
} 
 
Window_Base.prototype.drawButton = function(faceName, x, y, width, height) {      
    var bitmap = ImageManager.loadSystem(faceName);      
    this.contents.blt(bitmap, 0, 0, width, height, x, y);  
}; 
 
ImageManager.loadHitMouse = function(filename, hue) {// 
        return this.loadBitmap('img/HitMouse/', filename, hue, true); 
}; 
Window_MapStatus.prototype.adjustSprite = function(sprite) { 
        sprite.scale.x = this._scaleX * 0.85; 
        sprite.scale.y = this._scaleY * 0.85; 
    sprite.anchor.x = 0.5; 
    sprite.anchor.y = 0.5; 
        this.addChild(sprite); 
}; 
 
 
Window_MapStatus.prototype.refresh = function () { 
        //这里的图片显示不出来 
        this._dizzyBitmap = ImageManager.loadHitMouse("star"); 
         
        this.contents.blt(this._dizzyBitmap, 0, 0, 120, 70, 5, 30,120,70); 
} 
Scene_Map.prototype.createDisplayObjects = function () { 
    //创建精灵组 
    this.createSpriteset(); 
    //创建地图名称窗口 
    this.createMapNameWindow(); 
    //创建窗口层 
    this.createWindowLayer(); 
    //创建所有窗口 
    this.createAllWindows(); 
 
    //创建一个显示角色状态的窗口 
    this.createStatusWindow(); 
 
 
 
}; 
 
//创建一个显示名字的窗口 
Scene_Map.prototype.createStatusWindow = function () { 
    this._StatusWindow = new Window_MapStatus(200, 200, 410, 216); 
    this.addWindow(this._StatusWindow); //把窗口添加到窗口层 
 
}; 
 
大佬,小女跪谢了 |   
 
 
最佳答案
查看完整内容 
Scene_Map.prototype.createStatusWindow = function () {
    this._StatusWindow = new Window_MapStatus(0, 0, 410, 216);
    this.addWindow(this._StatusWindow); //把窗口添加到窗口层
        SceneManager.push(Window_MapStatus);
};
你在这句函数里面注释掉SceneManager.push(Window_MapStatus);这句代码,窗口类不是scene类,有些函数读取不了 
 
 
 
 
 
 
 |