File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ Phaser.Component.Color = function (gameObject)
2323
2424 this . _blendMode = 0 ;
2525
26- this . _tint = [ ] ;
26+ this . _tint = [ 0xffffff , 0xffffff , 0xffffff , 0xffffff ] ;
2727 this . _hasTint = false ;
2828
2929 this . _r = 0 ;
@@ -56,6 +56,25 @@ Phaser.Component.Color.prototype = {
5656 this . setDirty ( ) ;
5757 } ,
5858
59+ clearTint : function ( )
60+ {
61+ this . _hasTint = false ;
62+
63+ this . setDirty ( ) ;
64+ } ,
65+
66+ setTint : function ( topLeft , topRight , bottomLeft , bottomRight )
67+ {
68+ this . _tint [ 0 ] = topLeft ;
69+ this . _tint [ 1 ] = topRight ;
70+ this . _tint [ 2 ] = bottomLeft ;
71+ this . _tint [ 3 ] = bottomRight ;
72+
73+ this . _hasTint = true ;
74+
75+ this . setDirty ( ) ;
76+ } ,
77+
5978 getBlendMode : function ( )
6079 {
6180 return this . _blendMode ;
@@ -102,6 +121,34 @@ Phaser.Component.Color.prototype = {
102121
103122Object . defineProperties ( Phaser . Component . Color . prototype , {
104123
124+ tint : {
125+
126+ enumerable : true ,
127+
128+ get : function ( )
129+ {
130+ return this . _tint ;
131+ } ,
132+
133+ set : function ( value )
134+ {
135+ if ( Array . isArray ( value ) )
136+ {
137+ this . _tint = value ;
138+ }
139+ else
140+ {
141+ this . _tint [ 0 ] = value ;
142+ this . _tint [ 1 ] = value ;
143+ this . _tint [ 2 ] = value ;
144+ this . _tint [ 3 ] = value ;
145+ }
146+
147+ this . setDirty ( ) ;
148+ }
149+
150+ } ,
151+
105152 alpha : {
106153
107154 enumerable : true ,
You can’t perform that action at this time.
0 commit comments