mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-22 20:06:49 +01:00
Set up transform notification for VertexLight2D.
This commit is contained in:
parent
9ce6ebc1b5
commit
9df448113d
@ -83,12 +83,22 @@ VertexLight2D::VertexLight2D() {
|
||||
_item_cull_mask = 1;
|
||||
_z_range = Vector2i(-1024, 1024);
|
||||
_mode = VERTEX_LIGHT_2D_MODE_ADD;
|
||||
|
||||
set_notify_transform(true);
|
||||
}
|
||||
|
||||
VertexLight2D::~VertexLight2D() {
|
||||
VertexLights2DServer::get_singleton()->free(_vertex_light);
|
||||
}
|
||||
|
||||
void VertexLight2D::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_TRANSFORM_CHANGED: {
|
||||
VertexLights2DServer::get_singleton()->light_set_position(_vertex_light, get_global_transform().get_origin());
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
void VertexLight2D::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_color"), &VertexLight2D::get_color);
|
||||
ClassDB::bind_method(D_METHOD("set_color", "color"), &VertexLight2D::set_color);
|
||||
|
@ -71,6 +71,8 @@ public:
|
||||
~VertexLight2D();
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
|
||||
static void _bind_methods();
|
||||
|
||||
RID _vertex_light;
|
||||
|
Loading…
Reference in New Issue
Block a user