Add set/get_light_mask_value(layer_number)
methods to CanvasItem
#3472
Labels
set/get_light_mask_value(layer_number)
methods to CanvasItem
#3472
Describe the project you are working on
Godot.
Describe the problem or limitation you are having in your project
Currently there's no utility methods for getting/setting value (enabled/disabled) for a specific layer of
CanvasItem::light_mask
. It makes dealing withlight_mask
's layers in code not user-friendly (as not everyone is familiar with bitwise operators; also performing layer-involved logic manually is more error prone). Here's an example of a confused user.Such utility methods are available for other similar properties involving layers like
VisualInstance::layers
,CollisionObject2D/3D::collision_layer/mask
and so on (see: godotengine/godot#51532).Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add user-friendly methods:
CanvasItem::set_light_mask_value(int layer_number, bool value)
,CanvasItem::get_light_mask_value(int layer_number)
and expose them to the scripting languages. It will help the same way as other similar methods (see godotengine/godot#51532) - there will be no need to manipulate layer bits manually.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Implementation similar as in godotengine/godot#51532.
If this enhancement will not be used often, can it be worked around with a few lines of script?
No idea if it will be used often.
Is there a reason why this should be core and not an add-on in the asset library?
It changes in-core class.
The text was updated successfully, but these errors were encountered: