Skip to content

Commit 1931716

Browse files
committed
Exposed isTinted bool
1 parent fdd4a8f commit 1931716

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ As well as tidying the Texture Tint Pipeline, I also updated the shader. It now
6565

6666
* `setTintFill` is a new method available to all Game Objects that have the Tint component. It differs from `setTint` in that the colors literally replace the pixel values from the texture (while still respecting the alpha). This means you can now create effects such as flashing a sprite white if it gets hit, or red for damage, etc. You can still use different colors per corner of the Game Object, allowing you to create nice seamless gradient effects.
6767
* `tintFill` is a new boolean property that allows you to toggle between the two different tint types: multiply or replace.
68-
* `_isTinted` is a new private boolean indicating if a Game Object is tinted or not.
68+
* `isTinted` is a new read-only boolean indicating if a Game Object is tinted or not. Handy for knowing if you need to clear a tint after an effect.
6969

7070
The Tint component documentation has been overhauled to explain these differences in more detail, and you can find lots of new examples as well.
7171

@@ -123,6 +123,7 @@ There is a new Game Object Component called `TextureCrop`. It replaces the Textu
123123
* The `Pointer.camera` property would only be set if there was a viable Game Object in the camera view. Now it is set regardless, to always be the Camera the Pointer interacted with.
124124
* Added the Mask component to Container. It worked without it, but this brings it in-line with the documentation and other Game Objects. Fix #3797 (thanks @zilbuz)
125125
* The DataManager couldn't redefine previously removed properties. Fix #3803 (thanks @AleBles @oo7ph)
126+
* The Canvas DrawImage function has been recoded entirely so it now correctly supports parent matrix and camera matrix calculations. This fixes an issue where children inside Containers would lose their rotation, and other issues, when in the Canvas Renderer. Fix #3728 (thanks @samid737)
126127

127128
### Examples, Documentation and TypeScript
128129

src/gameobjects/components/Tint.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,24 @@ var Tint = {
308308
{
309309
this.setTint(value, value, value, value);
310310
}
311+
},
312+
313+
/**
314+
* Does this Game Object have a tint applied to it or not?
315+
*
316+
* @name Phaser.GameObjects.Components.Tint#isTinted
317+
* @type {boolean}
318+
* @webglOnly
319+
* @readOnly
320+
* @since 3.11.0
321+
*/
322+
isTinted: {
323+
324+
get: function ()
325+
{
326+
return this._isTinted;
327+
}
328+
311329
}
312330

313331
};

0 commit comments

Comments
 (0)