Hello,
I’m currently working on a project using Phaser 3. I’m tring to save a sprite (“object” in the code section below) current color before modifying it. I am saving the values of tintBottomLeft, tintBottomRight, tintTopLeft and tintTopRigh into 4 other variables.
object.on('pointerover', function() {
console.log(object);
console.log("_tintBL", object._tintBL);
previousTintBL = object.tintBottomLeft;
previousTintBR = object.tintBottomRight;
previousTintTL = object.tintTopLeft;
previousTintTR = object.tintTopRight;
object.setTint(0xff00ff);
});
object.on('pointerout', function() {
object.clearTint();
object.setTint(previousTintTL, previousTintTR, previousTintBL, previousTintBR);
previousTintBL = object.tintBottomLeft;
previousTintBR = object.tintBottomRight;
previousTintTL = object.tintTopLeft;
previousTintTR = object.tintTopRight;
});
The problem is that the sprite current color is 16711680. But when I’m accessing the variable _tintBL alone, the color is now 255 and I really don’t understand why this is happening (printed using console.log, image linked)
Any help ?