[RMMV] IMAGES
Posts
Pages:
1
Am I doing something wrong?
I seem to always land in trouble when I use bitmap.blt() in RMMV.
The below code will fail to produce the image, but the fillRect line works properly.
And this line works for creating a sprite based off a bitmap.
I can then clearRect and fillRect on it, but
The moment I try to use a blt, it just won't work.
It's been driving me crazy because I cannot make anything with this! Please help ;w;!
I seem to always land in trouble when I use bitmap.blt() in RMMV.
The below code will fail to produce the image, but the fillRect line works properly.
var bmp = ImageManager.loadSystem("ctbicon_a_0"); this.contents.fillRect(0, 0, this.contents.width, itemHeight, this._bgColor); this.contents.blt(bmp, 0, 0, 128, 192, 0, 0, 128, 192);
And this line works for creating a sprite based off a bitmap.
this.hazardGaugeBack= new Sprite_Base(); this.hazardGaugeBack.bitmap = ImageManager.loadSystem('hazback');
this.hazardGaugeFill.bitmap = ImageManager.loadSystem('hazfillempty'); var hazFillImage = ImageManager.loadSystem('hazfillnormal'); this.hazardGaugeFill.bitmap.blt(hazFillImage, sx, 0, sw, 16);
It's been driving me crazy because I cannot make anything with this! Please help ;w;!
Resolved!
For those who are encountering similar problems, this might be handy:
http://forums.rpgmakerweb.com/index.php?/topic/46341-javascript-questions-that-dont-deserve-their-own-thread/&do=findComment&comment=560889
For those who are encountering similar problems, this might be handy:
http://forums.rpgmakerweb.com/index.php?/topic/46341-javascript-questions-that-dont-deserve-their-own-thread/&do=findComment&comment=560889
author=lavra
Your last example seems to be missing some parameters, so that can't work, anyway. For the first example make sure, that:
- Your given width (the first 128) and height (the first 192) aren't greater, than the source bitmap's dimensions. Otherwise, blt will silently fail.
- The bitmap has loaded, already. Usually this is done by loading bitmaps during Scene.create and rendering them in Scene.start and later. If you are loading the bitmap dynamically, you'll need to add a load listener, that will wait until it's loaded and draw it, afterwards.
The easier way would be to simply display another sprite on top of the background. Uses up slightly more memory, but you won't get any issues with asynchronous loading.
Pages:
1














