diff options
Diffstat (limited to 'scene/2d/light_occluder_2d.cpp')
-rw-r--r-- | scene/2d/light_occluder_2d.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp index d98bed0ea3..ce617b1737 100644 --- a/scene/2d/light_occluder_2d.cpp +++ b/scene/2d/light_occluder_2d.cpp @@ -45,6 +45,8 @@ RID OccluderPolygon2D::get_rid() const { return occ_polygon; } + + void OccluderPolygon2D::_bind_methods() { @@ -178,6 +180,20 @@ int LightOccluder2D::get_occluder_light_mask() const{ return mask; } + +String LightOccluder2D::get_configuration_warning() const { + + if (!occluder_polygon.is_valid()) { + return TTR("An occluder polygon must be set (or drawn) for this occluder to take effect."); + } + + if (occluder_polygon.is_valid() && occluder_polygon->get_polygon().size()==0) { + return TTR("The occluder polygon for this occluder is empty. Please draw a polygon!"); + } + + return String(); +} + void LightOccluder2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_occluder_polygon","polygon:OccluderPolygon2D"),&LightOccluder2D::set_occluder_polygon); |