First of all this is a rough draft of what i need to have my plugin working:
Testing = {}_isDatabaseLoadedtest = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() { if (!_isDatabaseLoadedtest.call(this)) return false; // loading a parallax because it's big Testing.bitmap = ImageManager.loadParallax('BlueSky') console.log('here is the sooner i can load the bitmap') Testing.bitmap.addLoadListener( function() { console.log('this is when the getPixel is called') Testing.firstPixel = Testing.bitmap.getPixel(0, 0); }.bind(this) ) return true;};Window_Base.prototype.createContents = function() { this.contents = new Bitmap(this.contentsWidth(), this.contentsHeight()); this.resetFontSettings(); console.log('i need the pixel here') console.log(Testing.firstPixel);};Basically i need to make some checks on the bitmap (wich includes getting some of it's pixels and other things)
But the issue is that the image is loaded after the 'createContents' is called.
Sometimes it works (it loads the bitmap fast) but it's not the norm.
Testing = {}_isDatabaseLoadedtest = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() { if (!_isDatabaseLoadedtest.call(this)) return false; // loading a parallax because it's big Testing.bitmap = ImageManager.loadParallax('BlueSky') console.log('here is the sooner i can load the bitmap') Testing.bitmap.addLoadListener( function() { console.log('this is when the getPixel is called') Testing.firstPixel = Testing.bitmap.getPixel(0, 0); }.bind(this) ) return true;};Window_Base.prototype.createContents = function() { this.contents = new Bitmap(this.contentsWidth(), this.contentsHeight()); this.resetFontSettings(); console.log('i need the pixel here') console.log(Testing.firstPixel);};Basically i need to make some checks on the bitmap (wich includes getting some of it's pixels and other things)
But the issue is that the image is loaded after the 'createContents' is called.
Sometimes it works (it loads the bitmap fast) but it's not the norm.