summaryrefslogtreecommitdiff
path: root/scene/2d/canvas_item.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/canvas_item.h')
-rw-r--r--scene/2d/canvas_item.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h
index 604eef0527..ed3ade9df2 100644
--- a/scene/2d/canvas_item.h
+++ b/scene/2d/canvas_item.h
@@ -32,6 +32,7 @@
#include "scene/main/node.h"
#include "scene/resources/texture.h"
#include "scene/main/scene_main_loop.h"
+#include "scene/resources/shader.h"
class CanvasLayer;
class Viewport;
@@ -80,6 +81,9 @@ private:
bool block_transform_notify;
bool behind;
+ bool use_parent_shader;
+ Ref<Shader> shader;
+
mutable Matrix32 global_transform;
mutable bool global_invalid;
@@ -99,8 +103,9 @@ private:
void _queue_sort_children();
void _sort_children();
-
-
+#ifdef TOOLS_ENABLED
+ void _shader_changed();
+#endif
void _notify_transform(CanvasItem *p_node);
void _set_on_top(bool p_on_top) { set_draw_behind_parent(!p_on_top); }
@@ -108,9 +113,12 @@ private:
protected:
+ bool _set(const StringName& p_name, const Variant& p_value);
+ bool _get(const StringName& p_name,Variant &r_ret) const;
+ void _get_property_list( List<PropertyInfo> *p_list) const;
- _FORCE_INLINE_ void _notify_transform() { if (!is_inside_scene()) return; _notify_transform(this); if (!block_transform_notify) notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED); }
+ _FORCE_INLINE_ void _notify_transform() { if (!is_inside_tree()) return; _notify_transform(this); if (!block_transform_notify) notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED); }
void item_rect_changed();
@@ -120,7 +128,7 @@ public:
enum {
- NOTIFICATION_TRANSFORM_CHANGED=SceneMainLoop::NOTIFICATION_TRANSFORM_CHANGED, //unique
+ NOTIFICATION_TRANSFORM_CHANGED=SceneTree::NOTIFICATION_TRANSFORM_CHANGED, //unique
NOTIFICATION_DRAW=30,
NOTIFICATION_VISIBILITY_CHANGED=31,
NOTIFICATION_ENTER_CANVAS=32,
@@ -204,7 +212,14 @@ public:
RID get_canvas() const;
Ref<World2D> get_world_2d() const;
+ void set_shader(const Ref<Shader>& p_shader);
+ Ref<Shader> get_shader() const;
+
+ void set_use_parent_shader(bool p_use_parent_shader);
+ bool get_use_parent_shader() const;
+ void set_shader_param(const StringName& p_param,const Variant& p_value);
+ Variant get_shader_param(const StringName& p_param) const;
CanvasItem();
~CanvasItem();