Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
1,545
Reaction score
1,035
First Language
Polish
Primarily Uses
RMMV
As title says, I've tried this code to make messages transparent for online version, but in all of my installed browsers:
Opera, Chrome, Brave messages display with default skin window.
Code:
(function(){
    
    'use strict';
    
    Game_Message.prototype.background = function() {
        this._background = 2; //transparent
        return this._background;
})();

Then I changed a little Game_Interpreter command directly in rpg_objects.js to following:
Code:
// Show Text
Game_Interpreter.prototype.command101 = function() {
    if (!$gameMessage.isBusy()) {
        $gameMessage.setFaceImage(this._params[0], this._params[1]);
        $gameMessage.setBackground(2);
        $gameMessage.setPositionType(this._params[3]);
        while (this.nextEventCode() === 401) {  // Text data
            this._index++;
            $gameMessage.add(this.currentCommand().parameters[0]);
        }
        switch (this.nextEventCode()) {
        case 102:  // Show Choices
            this._index++;
            this.setupChoices(this.currentCommand().parameters);
            break;
        case 103:  // Input Number
            this._index++;
            this.setupNumInput(this.currentCommand().parameters);
            break;
        case 104:  // Select Item
            this._index++;
            this.setupItemChoice(this.currentCommand().parameters);
            break;
        }
        this._index++;
        this.setWaitMode('message');
    }
    return false;
};

And still nothing, what am I missing with this?
(I'd like to mention I'm running tests on localhost and each change in code is followed with Apache restart, clearing all caches and tmp files).
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,743
Reaction score
2,099
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi!

You can try do just that:

JavaScript:
Window_Message.prototype.updateBackground = function() {
    this._background = 2
    this.setBackgroundType(this._background);
};

For better understanding, a transparent window, is only a window with their opacity set to 0:

JavaScript:
Window_Base.prototype.setBackgroundType = function(type) {
    if (type === 0) {
        this.opacity = 255;
    } else {
        this.opacity = 0;
    }
    if (type === 1) {
        this.showBackgroundDimmer();
    } else {
        this.hideBackgroundDimmer();
    }
};
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
1,545
Reaction score
1,035
First Language
Polish
Primarily Uses
RMMV
Ohh darn... I Forgot about Window_Base...

That solved problem, Thank you @Eliaquim .
 

Latest Threads

Latest Profile Posts

Not sure why I'm a jack of all trades , master of none... Sigh. Album out 06/03/2022 on all ur favorite platforms. 10 tracks.
Hmm... Mushrooms, maybe they're not poisonous...
unknown.png
Hi, I'm a new and upcoming Indie Developer, and I could really use some help when it comes to system programming. Explorers can only go so far before needing a map, you know?
I made a comic strip with the characters of my game.Flor en la cola eng.jpg
Hey, what does it mean in settings, privacy, where it says allow users to: view your identities??????????

Forum statistics

Threads
122,050
Messages
1,146,150
Members
160,327
Latest member
Whitepard
Top