MZ Opacity of Text and Images

Hi all,

I have the following bit of code which is present in an Update method for a Window:

JavaScript:
this._currentCharacterData = this._characterQueue.shift();

const x = 40;
const y = 58;

this.drawCharacter(this._currentCharacterData.name, this._currentCharacterData.index, x, y);
this.drawText(this._currentCharacterData.text, x + 32, y - 40, Graphics.boxWidth, "left");

Currently, this draws a characters picture and a piece of text to the screen, which is working quite well. I'm looking to try to make this disappear after a certain amount of time. The timer portion I can do, but the actual "make this appear and disappear" section is the tricky part. So, in all:
  • How would one go about controlling the opacity of texts and images created in this manner?
  • How would one go about telling RPG Maker that they're no longer needed and can be destroyed?
Hi!
Well, I think if it is inside a window, you can change the opacity of the contents.
this.contentsOpacity or this.contents.opacity, something like that...


For the fade in and out, you can try to check how Game_Screen.prototype does and update the fade and copy the logic to your window too.
Hi!
Well, I think if it is inside a window, you can change the opacity of the contents.
this.contentsOpacity or this.contents.opacity, something like that...


For the fade in and out, you can try to check how Game_Screen.prototype does and update the fade and copy the logic to your window too.
this.contentsOpacity was exactly what I was looking for, thanks for pointing me in the right direction! I am still trying to figure out how to tell RPG Maker that the picture and text are no longer needed and can be destroyed, unfortunately.

Original thread: https://forums.rpgmakerweb.com/threads/opacity-of-text-and-images.127424/