Hi guys!
Here Nio Kasgami for explain something in particuliar.
Sprite loading
So People Might think it's work's like Ace...it's kinda work's like Ace...but in same time Not at all!
I will be direct....ImageManager is far more complex than our default Cache when you just loaded the bitmap and this was loaded!
NOPE NOPE....
How in it's work in MV :
They have though some exception where you can directly draw the bitmap...it's when you start a scene since SceneManager already handles the pre-load.
but what's about when you want example to show in the middle of the scene....a message bust? Then if you show immediately the sprite when you created the method...it's will provoke lags! that's not funny huh?
so let's step by step show you how to do the stuff
you first example initialize the sprite but that's the classic
Dummy.prototype.initialize = function(){this.createSprite();};Now when you create the sprite it's like in ace! Although DO NOT REFERENCE the Bitmap! because it's will imidiatly draw the Sprite and also be sure to set the visibility to false or this will also try to load it.
Dummy.prototype.createSprite() {this._sprite = new Sprite();this._sprite.anchor.x = 0.5;this._sprite.anchor.y = 0.5;this._sprite.visible = false;this.addChild(this._sprite);}now the material is "referenced" but now for show it you may need in the update method by using a requirement to the cache.
Dummy.prototype.update = function() {if !(ImageManager.isReady()) { this.loadBitmap(); } else { this.drawSprite();this._bitmap = null;}with that it's will load the bitmap and draw the bitmap...but please this a rought idea don't make this like that lol
you can reference yourself to Window_Message who are a perfect example of how load bitmap in MV.
Finally here the two final steps for make it work's properly
Dummy.prototype.loadBitmap = function(){this._bitmap = ImageManage.loadSystem('bitmapName');};Dummy.prototype.drawBitmap = function(){this._sprite.bitmap = ImageManager.loadSystem('bitmapName');this._sprite.visible = true;}with that the first method preload the picture so it's still in the system although it's not added to the child so it's will not appear.
and the second catch the bitmap and permit to draw it on the screen!
and after you input it to the system.
It's simple like that...
and OH....Dispose just not exist in MV so you have to either change the bitmap name to ("");
or to setup to invisible but the first method remove memory usage.
I hope it's will help you guys 🙂
Here Nio Kasgami for explain something in particuliar.
Sprite loading
So People Might think it's work's like Ace...it's kinda work's like Ace...but in same time Not at all!
I will be direct....ImageManager is far more complex than our default Cache when you just loaded the bitmap and this was loaded!
NOPE NOPE....
How in it's work in MV :
- create the bitmap
- "preload" the bitmap
- "draw" the bitmap
They have though some exception where you can directly draw the bitmap...it's when you start a scene since SceneManager already handles the pre-load.
but what's about when you want example to show in the middle of the scene....a message bust? Then if you show immediately the sprite when you created the method...it's will provoke lags! that's not funny huh?
so let's step by step show you how to do the stuff
you first example initialize the sprite but that's the classic
Dummy.prototype.initialize = function(){this.createSprite();};Now when you create the sprite it's like in ace! Although DO NOT REFERENCE the Bitmap! because it's will imidiatly draw the Sprite and also be sure to set the visibility to false or this will also try to load it.
Dummy.prototype.createSprite() {this._sprite = new Sprite();this._sprite.anchor.x = 0.5;this._sprite.anchor.y = 0.5;this._sprite.visible = false;this.addChild(this._sprite);}now the material is "referenced" but now for show it you may need in the update method by using a requirement to the cache.
Dummy.prototype.update = function() {if !(ImageManager.isReady()) { this.loadBitmap(); } else { this.drawSprite();this._bitmap = null;}with that it's will load the bitmap and draw the bitmap...but please this a rought idea don't make this like that lol
you can reference yourself to Window_Message who are a perfect example of how load bitmap in MV.
Finally here the two final steps for make it work's properly
Dummy.prototype.loadBitmap = function(){this._bitmap = ImageManage.loadSystem('bitmapName');};Dummy.prototype.drawBitmap = function(){this._sprite.bitmap = ImageManager.loadSystem('bitmapName');this._sprite.visible = true;}with that the first method preload the picture so it's still in the system although it's not added to the child so it's will not appear.
and the second catch the bitmap and permit to draw it on the screen!
and after you input it to the system.
It's simple like that...
and OH....Dispose just not exist in MV so you have to either change the bitmap name to ("");
or to setup to invisible but the first method remove memory usage.
I hope it's will help you guys 🙂