32 #include "scene/main/node.h" 33 #include "scene/resources/texture.h" 34 #include "scene/main/scene_main_loop.h" 35 #include "scene/resources/shader.h" 57 ShadingMode shading_mode;
63 void _shader_changed();
64 static void _bind_methods();
76 void set_shading_mode(ShadingMode p_mode);
77 ShadingMode get_shading_mode()
const;
79 virtual RID get_rid()
const;
84 VARIANT_ENUM_CAST( CanvasItemMaterial::ShadingMode );
98 BLEND_MODE_PREMULT_ALPHA
117 BlendMode blend_mode;
124 bool pending_children_sort;
126 bool block_transform_notify;
128 bool use_parent_material;
129 bool notify_local_transform;
134 mutable bool global_invalid;
139 void _propagate_visibility_changed(
bool p_visible);
141 void _set_visible_(
bool p_visible);
142 bool _is_visible_()
const;
144 void _update_callback();
146 void _enter_canvas();
149 void _queue_sort_children();
150 void _sort_children();
154 void _set_on_top(
bool p_on_top) { set_draw_behind_parent(!p_on_top); }
155 bool _is_on_top()
const {
return !is_draw_behind_parent_enabled(); }
159 _FORCE_INLINE_
void _notify_transform() {
if (!is_inside_tree())
return; _notify_transform(
this);
if (!block_transform_notify && notify_local_transform) notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED); }
161 void item_rect_changed();
163 void _notification(
int p_what);
164 static void _bind_methods();
169 NOTIFICATION_TRANSFORM_CHANGED=SceneTree::NOTIFICATION_TRANSFORM_CHANGED,
170 NOTIFICATION_DRAW=30,
171 NOTIFICATION_VISIBILITY_CHANGED=31,
172 NOTIFICATION_ENTER_CANVAS=32,
173 NOTIFICATION_EXIT_CANVAS=33,
174 NOTIFICATION_LOCAL_TRANSFORM_CHANGED=35,
175 NOTIFICATION_WORLD_2D_CHANGED=36,
181 virtual Variant edit_get_state()
const;
182 virtual void edit_set_state(
const Variant& p_state);
183 virtual void edit_set_rect(
const Rect2& p_edit_rect);
184 virtual void edit_rotate(
float p_rot);
185 virtual Size2 edit_get_minimum_size()
const;
189 bool is_visible()
const;
190 bool is_hidden()
const;
193 void set_hidden(
bool p_hidden);
197 void set_blend_mode(BlendMode p_blend_mode);
198 BlendMode get_blend_mode()
const;
200 virtual void set_light_mask(
int p_light_mask);
201 int get_light_mask()
const;
203 void set_opacity(
float p_opacity);
204 float get_opacity()
const;
206 void set_self_opacity(
float p_self_opacity);
207 float get_self_opacity()
const;
211 void draw_line(
const Point2& p_from,
const Point2& p_to,
const Color& p_color,
float p_width=1.0);
212 void draw_rect(
const Rect2& p_rect,
const Color& p_color);
213 void draw_circle(
const Point2& p_pos,
float p_radius,
const Color& p_color);
215 void draw_texture_rect(
const Ref<Texture>& p_texture,
const Rect2& p_rect,
bool p_tile=
false,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false);
216 void draw_texture_rect_region(
const Ref<Texture>& p_texture,
const Rect2& p_rect,
const Rect2& p_src_rect,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false);
225 void draw_set_transform(
const Point2& p_offset,
float p_rot,
const Size2& p_scale);
229 void set_as_toplevel(
bool p_toplevel);
230 bool is_set_as_toplevel()
const;
232 void set_draw_behind_parent(
bool p_enable);
233 bool is_draw_behind_parent_enabled()
const;
237 virtual Rect2 get_item_rect()
const=0;
238 virtual Matrix32 get_transform()
const=0;
240 virtual Matrix32 get_global_transform()
const;
241 virtual Matrix32 get_global_transform_with_canvas()
const;
244 _FORCE_INLINE_
RID get_canvas_item()
const {
return canvas_item; }
246 void set_block_transform_notify(
bool p_enable);
247 bool is_block_transform_notify_enabled()
const;
250 Matrix32 get_canvas_transform()
const;
251 Matrix32 get_viewport_transform()
const;
252 Rect2 get_viewport_rect()
const;
253 RID get_viewport_rid()
const;
254 RID get_canvas()
const;
260 void set_use_parent_material(
bool p_use_parent_material);
261 bool get_use_parent_material()
const;
265 Vector2 get_global_mouse_pos()
const;
266 Vector2 get_local_mouse_pos()
const;
268 void set_notify_local_transform(
bool p_enable);
269 bool is_local_transform_notification_enabled()
const;
271 int get_canvas_layer()
const;
277 VARIANT_ENUM_CAST( CanvasItem::BlendMode );
279 #endif // CANVAS_ITEM_H
Definition: viewport.h:75
Definition: math_2d.h:204
Definition: string_db.h:48
Definition: canvas_item.h:87
Definition: resource.h:89
Definition: canvas_layer.h:37
Definition: canvas_item.h:43
Definition: math_2d.h:554
Definition: style_box.h:38