@@ -48,6 +48,8 @@ bool TileSet::_set(const StringName& p_name, const Variant& p_value) {
48
48
tile_set_texture_offset (id,p_value);
49
49
else if (what==" material" )
50
50
tile_set_material (id,p_value);
51
+ else if (what==" modulate" )
52
+ tile_set_modulate (id,p_value);
51
53
else if (what==" shape_offset" )
52
54
tile_set_shape_offset (id,p_value);
53
55
else if (what==" region" )
@@ -91,6 +93,8 @@ bool TileSet::_get(const StringName& p_name,Variant &r_ret) const{
91
93
r_ret=tile_get_texture_offset (id);
92
94
else if (what==" material" )
93
95
r_ret=tile_get_material (id);
96
+ else if (what==" modulate" )
97
+ r_ret=tile_get_modulate (id);
94
98
else if (what==" shape_offset" )
95
99
r_ret=tile_get_shape_offset (id);
96
100
else if (what==" region" )
@@ -124,6 +128,7 @@ void TileSet::_get_property_list( List<PropertyInfo> *p_list) const{
124
128
p_list->push_back (PropertyInfo (Variant::OBJECT,pre+" texture" ,PROPERTY_HINT_RESOURCE_TYPE," Texture" ));
125
129
p_list->push_back (PropertyInfo (Variant::VECTOR2,pre+" tex_offset" ));
126
130
p_list->push_back (PropertyInfo (Variant::OBJECT,pre+" material" ,PROPERTY_HINT_RESOURCE_TYPE," CanvasItemMaterial" ));
131
+ p_list->push_back (PropertyInfo (Variant::COLOR,pre+" modulate" ));
127
132
p_list->push_back (PropertyInfo (Variant::RECT2,pre+" region" ));
128
133
p_list->push_back (PropertyInfo (Variant::VECTOR2,pre+" occluder_offset" ));
129
134
p_list->push_back (PropertyInfo (Variant::OBJECT,pre+" occluder" ,PROPERTY_HINT_RESOURCE_TYPE," OccluderPolygon2D" ));
@@ -175,6 +180,20 @@ Ref<CanvasItemMaterial> TileSet::tile_get_material(int p_id) const{
175
180
}
176
181
177
182
183
+ void TileSet::tile_set_modulate (int p_id,const Color &p_modulate) {
184
+
185
+ ERR_FAIL_COND (!tile_map.has (p_id));
186
+ tile_map[p_id].modulate =p_modulate;
187
+ emit_changed ();
188
+
189
+ }
190
+
191
+ Color TileSet::tile_get_modulate (int p_id) const {
192
+
193
+ ERR_FAIL_COND_V (!tile_map.has (p_id),Color (1 ,1 ,1 ));
194
+ return tile_map[p_id].modulate ;
195
+ }
196
+
178
197
void TileSet::tile_set_texture_offset (int p_id,const Vector2 &p_offset) {
179
198
180
199
ERR_FAIL_COND (!tile_map.has (p_id));
0 commit comments