RMMZ Opacity of Text and Images

nathanlink169

Game Dev by Career, no idea what I'm doing
Veteran
Joined
Aug 15, 2013
Messages
72
Reaction score
32
First Language
English
Primarily Uses
RMMV
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?
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,696
Reaction score
1,113
First Language
Portuguese - Br
Primarily Uses
RMMZ
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.
 

nathanlink169

Game Dev by Career, no idea what I'm doing
Veteran
Joined
Aug 15, 2013
Messages
72
Reaction score
32
First Language
English
Primarily Uses
RMMV
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Posts

Latest Profile Posts

Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:

Forum statistics

Threads
105,883
Messages
1,017,236
Members
137,608
Latest member
Arm9
Top