11-24-2024, 04:55 AM
Ok, the classic happened... I found the solution after getting some pointers from someone else, so this post became pointless x'D
Should this be closed? I don't know what's the usual practice here.
In any case, and if you're curious, this is the explanation of what I did, which is a little silly, but works. Now I have to work on improving it, and making it dynamic if possible:
Because this is how I set up the timing in my common events, I changed fadeSpeed() to 21 (7 + 7 + 7), and modified slowFadeSpeed() so it was the same as fadeSpeed. (It is inconvenient for me to have different fade speeds, unless I want to assign more pictures to that).
Then I changed createFadeSprite() to this:
Which is very redundant and stupid x') But that's what I have to work on, lol. It creates 3 sprites and adds them to the scene.
Then, in startFadeIn() and startFadeOut() I deleted the this._fadeSprite.opacity = 0; since it was already unused. I added my this.spriteTrans1 to 3 accordingly (set to 0 opacity), and the timing was precisely in updateFade():
Which again, is very stupid. Because it only works properly if fadeSpeed is 21.
I also had to additionally set this.spriteTrans1.opacity to 0 when the transition is done, or else it would still be visible in the screen. Since the opacity doesn't change gradually like in the default functions, I guess I have to do that...
Should this be closed? I don't know what's the usual practice here.
In any case, and if you're curious, this is the explanation of what I did, which is a little silly, but works. Now I have to work on improving it, and making it dynamic if possible:
Because this is how I set up the timing in my common events, I changed fadeSpeed() to 21 (7 + 7 + 7), and modified slowFadeSpeed() so it was the same as fadeSpeed. (It is inconvenient for me to have different fade speeds, unless I want to assign more pictures to that).
Then I changed createFadeSprite() to this:
Code:
Scene_Base.prototype.createFadeSprite = function() {
this.spriteTrans1 = new Sprite();
this.spriteTrans1.bitmap = ImageManager.reservePicture("tranneg1");
this.addChild(this.spriteTrans1);
this.spriteTrans2 = new Sprite();
this.spriteTrans2.bitmap = ImageManager.reservePicture("tranneg2");
this.addChild(this.spriteTrans2)
this.spriteTrans3 = new Sprite();
this.spriteTrans3.bitmap = ImageManager.reservePicture("tranneg3");
this.addChild(this.spriteTrans3)
};
Which is very redundant and stupid x') But that's what I have to work on, lol. It creates 3 sprites and adds them to the scene.
Then, in startFadeIn() and startFadeOut() I deleted the this._fadeSprite.opacity = 0; since it was already unused. I added my this.spriteTrans1 to 3 accordingly (set to 0 opacity), and the timing was precisely in updateFade():
Code:
Scene_Base.prototype.updateFade = function() {
if (this._fadeDuration > 0) {
if (this._fadeSign > 0) {
//esto es fadein (venir de negro)
if(this._fadeDuration >14){
this.spriteTrans3.opacity = 255;
}
if(this._fadeDuration <= 14 && this._fadeDuration > 7){
this.spriteTrans3.opacity = 0;
this.spriteTrans2.opacity = 255;
}
if(this._fadeDuration <= 7){
this.spriteTrans2.opacity = 0;
this.spriteTrans1.opacity = 255;
}
} //esto de abajo es el fadeout (irse a negro)
else {
if(this._fadeDuration > 14){
this.spriteTrans1.opacity = 255;
}
if(this._fadeDuration <= 14 && this._fadeDuration >7){
this.spriteTrans1.opacity = 0;
this.spriteTrans2.opacity = 255;
}
if(this._fadeDuration <= 7){
this.spriteTrans2.opacity = 0;
this.spriteTrans3.opacity = 255;
}
}
this._fadeDuration--;
}
if(this._fadeDuration <= 0 && this.spriteTrans1){
this.spriteTrans1.opacity = 0;
}
};
Which again, is very stupid. Because it only works properly if fadeSpeed is 21.
I also had to additionally set this.spriteTrans1.opacity to 0 when the transition is done, or else it would still be visible in the screen. Since the opacity doesn't change gradually like in the default functions, I guess I have to do that...