mirror of
https://github.com/godotengine/godot.git
synced 2024-11-26 06:03:38 +00:00
Added compatibility for Blend Mode in Light2D/PointLight2D when converting from Godot 3 to 4
This commit is contained in:
parent
dbd139c91c
commit
58ae3c577c
@ -425,6 +425,17 @@ real_t PointLight2D::get_texture_scale() const {
|
||||
return _scale;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
bool PointLight2D::_set(const StringName &p_name, const Variant &p_value) {
|
||||
if (p_name == "mode" && p_value.is_num()) { // Compatibility with Godot 3.x.
|
||||
set_blend_mode((BlendMode)(int)p_value);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif // DISABLE_DEPRECATED
|
||||
|
||||
void PointLight2D::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_texture", "texture"), &PointLight2D::set_texture);
|
||||
ClassDB::bind_method(D_METHOD("get_texture"), &PointLight2D::get_texture);
|
||||
|
@ -146,6 +146,9 @@ private:
|
||||
Vector2 texture_offset;
|
||||
|
||||
protected:
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
bool _set(const StringName &p_name, const Variant &p_value);
|
||||
#endif // DISABLE_DEPRECATED
|
||||
static void _bind_methods();
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user