I want background < windos < pictrueView attachment 215837
I've been trying for a long time and my head is about to explode
I don't know how to change the correct layer
addWindow addChild addChildToBack addInnerChild this.addChildAt(child, containerIndex + 1); have tried
The picture is always at the bottom
new Sprite( ImageManager.loadPicture('Night')) can not
Should I use the sprite's prototype
this.createLowerLayer() or this.createUpperLayer()?
I've been trying for a long time and my head is about to explode
I don't know how to change the correct layer
addWindow addChild addChildToBack addInnerChild this.addChildAt(child, containerIndex + 1); have tried
The picture is always at the bottom
new Sprite( ImageManager.loadPicture('Night')) can not
Should I use the sprite's prototype
this.createLowerLayer() or this.createUpperLayer()?
let st = Scene_Map.prototype.createAllWindows;
Scene_Map.prototype.createAllWindows = function() {
st.call(this);
this.stCreateAll();
};
Scene_Base.prototype.stCreateAll = function() {
const rect = new this.wrect();
this.w1 = new w2(rect);
this.addChild(this.w1);
};
Scene_Base.prototype.wrect = function() {
const ww = 300;
const wh = 200;
const wx = 0;
const wy = 0;
return new Rectangle(wx, wy, ww, wh);
};
function w2() {
this.initialize(...arguments);
};
w2.prototype = Object.create(Window_Base.prototype);
w2.prototype.constructor = w2;
w2.prototype.initialize = function(rect) {
Window_Base.prototype.initialize.call(this, rect);
//this.opacity = 0;
this.createBackground();
this.refresh();
};
w2.prototype.refresh = function() {
this.contents.clear();
this.drawTextEx("this text EX",0,0);
};
w2.prototype.update = function() {
Window_Base.prototype.update.call(this);
this._backSprite1.origin.x += 1;
this._backSprite1.origin.y += 1;
this.refresh();
};
w2.prototype.createBackground = function () {
this._backSprite1 = new TilingSprite(
ImageManager.loadPicture('Night')
);
this._backSprite1.move(0, 0, 300, 200);
this._backSprite1.opacity = 125;
this.addChildToBack(this._backSprite1);
};