2015-02-16 18:45:11 +01:00
|
|
|
#ifndef LIGHT_2D_H
|
|
|
|
#define LIGHT_2D_H
|
|
|
|
|
|
|
|
#include "scene/2d/node_2d.h"
|
|
|
|
|
|
|
|
class Light2D : public Node2D {
|
|
|
|
|
|
|
|
OBJ_TYPE(Light2D,Node2D);
|
|
|
|
private:
|
|
|
|
RID canvas_light;
|
|
|
|
bool enabled;
|
|
|
|
bool shadow;
|
|
|
|
Color color;
|
|
|
|
float height;
|
2015-03-11 01:05:49 +01:00
|
|
|
float scale;
|
2015-02-16 18:45:11 +01:00
|
|
|
int z_min;
|
|
|
|
int z_max;
|
2015-02-18 23:39:44 +01:00
|
|
|
int layer_min;
|
|
|
|
int layer_max;
|
2015-02-16 18:45:11 +01:00
|
|
|
int item_mask;
|
2015-03-09 06:34:56 +01:00
|
|
|
int item_shadow_mask;
|
2015-03-02 04:54:10 +01:00
|
|
|
int shadow_buffer_size;
|
|
|
|
float shadow_esm_multiplier;
|
2015-02-18 23:39:44 +01:00
|
|
|
bool subtract_mode;
|
2015-02-16 18:45:11 +01:00
|
|
|
Ref<Texture> texture;
|
|
|
|
Vector2 texture_offset;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2015-02-18 23:39:44 +01:00
|
|
|
void _notification(int p_what);
|
2015-02-16 18:45:11 +01:00
|
|
|
static void _bind_methods();
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
2015-02-18 23:39:44 +01:00
|
|
|
virtual void edit_set_pivot(const Point2& p_pivot);
|
|
|
|
virtual Point2 edit_get_pivot() const;
|
|
|
|
virtual bool edit_has_pivot() const;
|
|
|
|
|
2015-02-16 18:45:11 +01:00
|
|
|
void set_enabled( bool p_enabled);
|
|
|
|
bool is_enabled() const;
|
|
|
|
|
|
|
|
void set_texture( const Ref<Texture>& p_texture);
|
|
|
|
Ref<Texture> get_texture() const;
|
|
|
|
|
|
|
|
void set_texture_offset( const Vector2& p_offset);
|
|
|
|
Vector2 get_texture_offset() const;
|
|
|
|
|
|
|
|
void set_color( const Color& p_color);
|
|
|
|
Color get_color() const;
|
|
|
|
|
|
|
|
void set_height( float p_height);
|
|
|
|
float get_height() const;
|
|
|
|
|
2015-03-11 01:05:49 +01:00
|
|
|
void set_scale( float p_scale);
|
|
|
|
float get_scale() const;
|
|
|
|
|
2015-02-16 18:45:11 +01:00
|
|
|
void set_z_range_min( int p_min_z);
|
|
|
|
int get_z_range_min() const;
|
|
|
|
|
|
|
|
void set_z_range_max( int p_max_z);
|
|
|
|
int get_z_range_max() const;
|
|
|
|
|
2015-02-18 23:39:44 +01:00
|
|
|
void set_layer_range_min( int p_min_layer);
|
|
|
|
int get_layer_range_min() const;
|
|
|
|
|
|
|
|
void set_layer_range_max( int p_max_layer);
|
|
|
|
int get_layer_range_max() const;
|
|
|
|
|
2015-02-16 18:45:11 +01:00
|
|
|
void set_item_mask( int p_mask);
|
|
|
|
int get_item_mask() const;
|
|
|
|
|
2015-03-09 06:34:56 +01:00
|
|
|
void set_item_shadow_mask( int p_mask);
|
|
|
|
int get_item_shadow_mask() const;
|
|
|
|
|
2015-02-18 23:39:44 +01:00
|
|
|
void set_subtract_mode( bool p_enable );
|
|
|
|
bool get_subtract_mode() const;
|
2015-02-16 18:45:11 +01:00
|
|
|
|
|
|
|
void set_shadow_enabled( bool p_enabled);
|
|
|
|
bool is_shadow_enabled() const;
|
|
|
|
|
2015-03-02 04:54:10 +01:00
|
|
|
void set_shadow_buffer_size( int p_size );
|
|
|
|
int get_shadow_buffer_size() const;
|
|
|
|
|
|
|
|
void set_shadow_esm_multiplier( float p_multiplier);
|
|
|
|
float get_shadow_esm_multiplier() const;
|
|
|
|
|
2015-02-18 23:39:44 +01:00
|
|
|
virtual Rect2 get_item_rect() const;
|
2015-02-16 18:45:11 +01:00
|
|
|
|
|
|
|
Light2D();
|
|
|
|
~Light2D();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // LIGHT_2D_H
|