canvas_item.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. /**************************************************************************/
  2. /* canvas_item.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #ifndef CANVAS_ITEM_H
  31. #define CANVAS_ITEM_H
  32. #include "scene/main/node.h"
  33. #include "scene/resources/canvas_item_material.h"
  34. #include "scene/resources/font.h"
  35. class CanvasLayer;
  36. class MultiMesh;
  37. class StyleBox;
  38. class Window;
  39. class World2D;
  40. class CanvasItem : public Node {
  41. GDCLASS(CanvasItem, Node);
  42. friend class CanvasLayer;
  43. public:
  44. enum TextureFilter {
  45. TEXTURE_FILTER_PARENT_NODE,
  46. TEXTURE_FILTER_NEAREST,
  47. TEXTURE_FILTER_LINEAR,
  48. TEXTURE_FILTER_NEAREST_WITH_MIPMAPS,
  49. TEXTURE_FILTER_LINEAR_WITH_MIPMAPS,
  50. TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC,
  51. TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC,
  52. TEXTURE_FILTER_MAX
  53. };
  54. enum TextureRepeat {
  55. TEXTURE_REPEAT_PARENT_NODE,
  56. TEXTURE_REPEAT_DISABLED,
  57. TEXTURE_REPEAT_ENABLED,
  58. TEXTURE_REPEAT_MIRROR,
  59. TEXTURE_REPEAT_MAX,
  60. };
  61. enum ClipChildrenMode {
  62. CLIP_CHILDREN_DISABLED,
  63. CLIP_CHILDREN_ONLY,
  64. CLIP_CHILDREN_AND_DRAW,
  65. CLIP_CHILDREN_MAX,
  66. };
  67. private:
  68. mutable SelfList<Node>
  69. xform_change;
  70. RID canvas_item;
  71. StringName canvas_group;
  72. CanvasLayer *canvas_layer = nullptr;
  73. Color modulate = Color(1, 1, 1, 1);
  74. Color self_modulate = Color(1, 1, 1, 1);
  75. List<CanvasItem *> children_items;
  76. List<CanvasItem *>::Element *C = nullptr;
  77. int light_mask = 1;
  78. uint32_t visibility_layer = 1;
  79. int z_index = 0;
  80. bool z_relative = true;
  81. bool y_sort_enabled = false;
  82. Window *window = nullptr;
  83. bool visible = true;
  84. bool parent_visible_in_tree = false;
  85. bool pending_update = false;
  86. bool top_level = false;
  87. bool drawing = false;
  88. bool block_transform_notify = false;
  89. bool behind = false;
  90. bool use_parent_material = false;
  91. bool notify_local_transform = false;
  92. bool notify_transform = false;
  93. bool hide_clip_children = false;
  94. ClipChildrenMode clip_children_mode = CLIP_CHILDREN_DISABLED;
  95. mutable RS::CanvasItemTextureFilter texture_filter_cache = RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR;
  96. mutable RS::CanvasItemTextureRepeat texture_repeat_cache = RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED;
  97. TextureFilter texture_filter = TEXTURE_FILTER_PARENT_NODE;
  98. TextureRepeat texture_repeat = TEXTURE_REPEAT_PARENT_NODE;
  99. Ref<Material> material;
  100. mutable Transform2D global_transform;
  101. mutable MTFlag global_invalid;
  102. _FORCE_INLINE_ bool _is_global_invalid() const { return is_group_processing() ? global_invalid.mt.is_set() : global_invalid.st; }
  103. void _set_global_invalid(bool p_invalid) const;
  104. void _top_level_raise_self();
  105. void _propagate_visibility_changed(bool p_parent_visible_in_tree);
  106. void _handle_visibility_change(bool p_visible);
  107. virtual void _top_level_changed();
  108. virtual void _top_level_changed_on_parent();
  109. void _redraw_callback();
  110. void _enter_canvas();
  111. void _exit_canvas();
  112. void _window_visibility_changed();
  113. void _notify_transform(CanvasItem *p_node);
  114. virtual void _physics_interpolated_changed() override;
  115. static CanvasItem *current_item_drawn;
  116. friend class Viewport;
  117. void _refresh_texture_repeat_cache() const;
  118. void _update_texture_repeat_changed(bool p_propagate);
  119. void _refresh_texture_filter_cache() const;
  120. void _update_texture_filter_changed(bool p_propagate);
  121. void _notify_transform_deferred();
  122. protected:
  123. virtual void _update_self_texture_repeat(RS::CanvasItemTextureRepeat p_texture_repeat);
  124. virtual void _update_self_texture_filter(RS::CanvasItemTextureFilter p_texture_filter);
  125. _FORCE_INLINE_ void _notify_transform() {
  126. _notify_transform(this);
  127. if (is_inside_tree() && !block_transform_notify && notify_local_transform) {
  128. notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
  129. }
  130. }
  131. void item_rect_changed(bool p_size_changed = true);
  132. void _notification(int p_what);
  133. static void _bind_methods();
  134. #ifndef DISABLE_DEPRECATED
  135. void _draw_circle_bind_compat_84472(const Point2 &p_pos, real_t p_radius, const Color &p_color);
  136. void _draw_rect_bind_compat_84523(const Rect2 &p_rect, const Color &p_color, bool p_filled, real_t p_width);
  137. void _draw_dashed_line_bind_compat_84523(const Point2 &p_from, const Point2 &p_to, const Color &p_color, real_t p_width, real_t p_dash, bool p_aligned);
  138. void _draw_multiline_bind_compat_84523(const Vector<Point2> &p_points, const Color &p_color, real_t p_width);
  139. void _draw_multiline_colors_bind_compat_84523(const Vector<Point2> &p_points, const Vector<Color> &p_colors, real_t p_width);
  140. static void _bind_compatibility_methods();
  141. #endif
  142. void _validate_property(PropertyInfo &p_property) const;
  143. _FORCE_INLINE_ void set_hide_clip_children(bool p_value) { hide_clip_children = p_value; }
  144. GDVIRTUAL0(_draw)
  145. public:
  146. enum {
  147. NOTIFICATION_TRANSFORM_CHANGED = SceneTree::NOTIFICATION_TRANSFORM_CHANGED, //unique
  148. NOTIFICATION_DRAW = 30,
  149. NOTIFICATION_VISIBILITY_CHANGED = 31,
  150. NOTIFICATION_ENTER_CANVAS = 32,
  151. NOTIFICATION_EXIT_CANVAS = 33,
  152. NOTIFICATION_LOCAL_TRANSFORM_CHANGED = 35,
  153. NOTIFICATION_WORLD_2D_CHANGED = 36,
  154. };
  155. /* EDITOR */
  156. #ifdef TOOLS_ENABLED
  157. // Select the node
  158. virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const;
  159. // Save and restore a CanvasItem state
  160. virtual void _edit_set_state(const Dictionary &p_state) {}
  161. virtual Dictionary _edit_get_state() const { return Dictionary(); }
  162. // Used to move the node
  163. virtual void _edit_set_position(const Point2 &p_position) = 0;
  164. virtual Point2 _edit_get_position() const = 0;
  165. // Used to scale the node
  166. virtual void _edit_set_scale(const Size2 &p_scale) = 0;
  167. virtual Size2 _edit_get_scale() const = 0;
  168. // Used to rotate the node
  169. virtual bool _edit_use_rotation() const { return false; };
  170. virtual void _edit_set_rotation(real_t p_rotation) {}
  171. virtual real_t _edit_get_rotation() const { return 0.0; };
  172. // Used to resize/move the node
  173. virtual bool _edit_use_rect() const { return false; }; // MAYBE REPLACE BY A _edit_get_editmode()
  174. virtual void _edit_set_rect(const Rect2 &p_rect) {}
  175. virtual Rect2 _edit_get_rect() const { return Rect2(0, 0, 0, 0); };
  176. virtual Size2 _edit_get_minimum_size() const { return Size2(-1, -1); }; // LOOKS WEIRD
  177. // Used to set a pivot
  178. virtual bool _edit_use_pivot() const { return false; };
  179. virtual void _edit_set_pivot(const Point2 &p_pivot) {}
  180. virtual Point2 _edit_get_pivot() const { return Point2(); };
  181. virtual Transform2D _edit_get_transform() const;
  182. #endif
  183. void update_draw_order();
  184. /* VISIBILITY */
  185. void set_visible(bool p_visible);
  186. bool is_visible() const;
  187. bool is_visible_in_tree() const;
  188. void show();
  189. void hide();
  190. void queue_redraw();
  191. void move_to_front();
  192. void set_clip_children_mode(ClipChildrenMode p_clip_mode);
  193. ClipChildrenMode get_clip_children_mode() const;
  194. virtual void set_light_mask(int p_light_mask);
  195. int get_light_mask() const;
  196. void set_modulate(const Color &p_modulate);
  197. Color get_modulate() const;
  198. Color get_modulate_in_tree() const;
  199. virtual void set_self_modulate(const Color &p_self_modulate);
  200. Color get_self_modulate() const;
  201. void set_visibility_layer(uint32_t p_visibility_layer);
  202. uint32_t get_visibility_layer() const;
  203. void set_visibility_layer_bit(uint32_t p_visibility_layer, bool p_enable);
  204. bool get_visibility_layer_bit(uint32_t p_visibility_layer) const;
  205. /* ORDERING */
  206. virtual void set_z_index(int p_z);
  207. int get_z_index() const;
  208. int get_effective_z_index() const;
  209. void set_z_as_relative(bool p_enabled);
  210. bool is_z_relative() const;
  211. virtual void set_y_sort_enabled(bool p_enabled);
  212. virtual bool is_y_sort_enabled() const;
  213. /* DRAWING API */
  214. void draw_dashed_line(const Point2 &p_from, const Point2 &p_to, const Color &p_color, real_t p_width = -1.0, real_t p_dash = 2.0, bool p_aligned = true, bool p_antialiased = false);
  215. void draw_line(const Point2 &p_from, const Point2 &p_to, const Color &p_color, real_t p_width = -1.0, bool p_antialiased = false);
  216. void draw_polyline(const Vector<Point2> &p_points, const Color &p_color, real_t p_width = -1.0, bool p_antialiased = false);
  217. void draw_polyline_colors(const Vector<Point2> &p_points, const Vector<Color> &p_colors, real_t p_width = -1.0, bool p_antialiased = false);
  218. void draw_arc(const Vector2 &p_center, real_t p_radius, real_t p_start_angle, real_t p_end_angle, int p_point_count, const Color &p_color, real_t p_width = -1.0, bool p_antialiased = false);
  219. void draw_multiline(const Vector<Point2> &p_points, const Color &p_color, real_t p_width = -1.0, bool p_antialiased = false);
  220. void draw_multiline_colors(const Vector<Point2> &p_points, const Vector<Color> &p_colors, real_t p_width = -1.0, bool p_antialiased = false);
  221. void draw_rect(const Rect2 &p_rect, const Color &p_color, bool p_filled = true, real_t p_width = -1.0, bool p_antialiased = false);
  222. void draw_circle(const Point2 &p_pos, real_t p_radius, const Color &p_color, bool p_filled = true, real_t p_width = -1.0, bool p_antialiased = false);
  223. void draw_texture(const Ref<Texture2D> &p_texture, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1, 1));
  224. void draw_texture_rect(const Ref<Texture2D> &p_texture, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false);
  225. void draw_texture_rect_region(const Ref<Texture2D> &p_texture, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, bool p_clip_uv = false);
  226. void draw_msdf_texture_rect_region(const Ref<Texture2D> &p_texture, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1), double p_outline = 0.0, double p_pixel_range = 4.0, double p_scale = 1.0);
  227. void draw_lcd_texture_rect_region(const Ref<Texture2D> &p_texture, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate = Color(1, 1, 1));
  228. void draw_style_box(const Ref<StyleBox> &p_style_box, const Rect2 &p_rect);
  229. void draw_primitive(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, Ref<Texture2D> p_texture = Ref<Texture2D>());
  230. void draw_polygon(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), Ref<Texture2D> p_texture = Ref<Texture2D>());
  231. void draw_colored_polygon(const Vector<Point2> &p_points, const Color &p_color, const Vector<Point2> &p_uvs = Vector<Point2>(), Ref<Texture2D> p_texture = Ref<Texture2D>());
  232. void draw_mesh(const Ref<Mesh> &p_mesh, const Ref<Texture2D> &p_texture, const Transform2D &p_transform = Transform2D(), const Color &p_modulate = Color(1, 1, 1));
  233. void draw_multimesh(const Ref<MultiMesh> &p_multimesh, const Ref<Texture2D> &p_texture);
  234. void draw_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField<TextServer::JustificationFlag> p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const;
  235. void draw_multiline_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_max_lines = -1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField<TextServer::LineBreakFlag> p_brk_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND, BitField<TextServer::JustificationFlag> p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const;
  236. void draw_string_outline(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField<TextServer::JustificationFlag> p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const;
  237. void draw_multiline_string_outline(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_max_lines = -1, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField<TextServer::LineBreakFlag> p_brk_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND, BitField<TextServer::JustificationFlag> p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const;
  238. void draw_char(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_char, int p_font_size = Font::DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0)) const;
  239. void draw_char_outline(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_char, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0)) const;
  240. void draw_set_transform(const Point2 &p_offset, real_t p_rot = 0.0, const Size2 &p_scale = Size2(1.0, 1.0));
  241. void draw_set_transform_matrix(const Transform2D &p_matrix);
  242. void draw_animation_slice(double p_animation_length, double p_slice_begin, double p_slice_end, double p_offset = 0);
  243. void draw_end_animation();
  244. static CanvasItem *get_current_item_drawn();
  245. /* RECT / TRANSFORM */
  246. void set_as_top_level(bool p_top_level);
  247. bool is_set_as_top_level() const;
  248. void set_draw_behind_parent(bool p_enable);
  249. bool is_draw_behind_parent_enabled() const;
  250. CanvasItem *get_parent_item() const;
  251. virtual Transform2D get_transform() const = 0;
  252. virtual Transform2D get_global_transform() const;
  253. virtual Transform2D get_global_transform_with_canvas() const;
  254. virtual Transform2D get_screen_transform() const;
  255. CanvasItem *get_top_level() const;
  256. _FORCE_INLINE_ RID get_canvas_item() const {
  257. return canvas_item;
  258. }
  259. void set_block_transform_notify(bool p_enable);
  260. bool is_block_transform_notify_enabled() const;
  261. Transform2D get_canvas_transform() const;
  262. Transform2D get_viewport_transform() const;
  263. Rect2 get_viewport_rect() const;
  264. RID get_viewport_rid() const;
  265. RID get_canvas() const;
  266. ObjectID get_canvas_layer_instance_id() const;
  267. Ref<World2D> get_world_2d() const;
  268. virtual void set_material(const Ref<Material> &p_material);
  269. Ref<Material> get_material() const;
  270. virtual void set_use_parent_material(bool p_use_parent_material);
  271. bool get_use_parent_material() const;
  272. Ref<InputEvent> make_input_local(const Ref<InputEvent> &p_event) const;
  273. Vector2 make_canvas_position_local(const Vector2 &screen_point) const;
  274. Vector2 get_global_mouse_position() const;
  275. Vector2 get_local_mouse_position() const;
  276. void set_notify_local_transform(bool p_enable);
  277. bool is_local_transform_notification_enabled() const;
  278. void set_notify_transform(bool p_enable);
  279. bool is_transform_notification_enabled() const;
  280. void force_update_transform();
  281. virtual void set_texture_filter(TextureFilter p_texture_filter);
  282. TextureFilter get_texture_filter() const;
  283. virtual void set_texture_repeat(TextureRepeat p_texture_repeat);
  284. TextureRepeat get_texture_repeat() const;
  285. TextureFilter get_texture_filter_in_tree() const;
  286. TextureRepeat get_texture_repeat_in_tree() const;
  287. // Used by control nodes to retrieve the parent's anchorable area
  288. virtual Rect2 get_anchorable_rect() const { return Rect2(0, 0, 0, 0); };
  289. int get_canvas_layer() const;
  290. CanvasLayer *get_canvas_layer_node() const;
  291. CanvasItem();
  292. ~CanvasItem();
  293. };
  294. VARIANT_ENUM_CAST(CanvasItem::TextureFilter)
  295. VARIANT_ENUM_CAST(CanvasItem::TextureRepeat)
  296. VARIANT_ENUM_CAST(CanvasItem::ClipChildrenMode)
  297. class CanvasTexture : public Texture2D {
  298. GDCLASS(CanvasTexture, Texture2D);
  299. OBJ_SAVE_TYPE(Texture2D); // Saves derived classes with common type so they can be interchanged.
  300. Ref<Texture2D> diffuse_texture;
  301. Ref<Texture2D> normal_texture;
  302. Ref<Texture2D> specular_texture;
  303. Color specular = Color(1, 1, 1, 1);
  304. real_t shininess = 1.0;
  305. RID canvas_texture;
  306. CanvasItem::TextureFilter texture_filter = CanvasItem::TEXTURE_FILTER_PARENT_NODE;
  307. CanvasItem::TextureRepeat texture_repeat = CanvasItem::TEXTURE_REPEAT_PARENT_NODE;
  308. protected:
  309. static void _bind_methods();
  310. public:
  311. void set_diffuse_texture(const Ref<Texture2D> &p_diffuse);
  312. Ref<Texture2D> get_diffuse_texture() const;
  313. void set_normal_texture(const Ref<Texture2D> &p_normal);
  314. Ref<Texture2D> get_normal_texture() const;
  315. void set_specular_texture(const Ref<Texture2D> &p_specular);
  316. Ref<Texture2D> get_specular_texture() const;
  317. void set_specular_color(const Color &p_color);
  318. Color get_specular_color() const;
  319. void set_specular_shininess(real_t p_shininess);
  320. real_t get_specular_shininess() const;
  321. void set_texture_filter(CanvasItem::TextureFilter p_filter);
  322. CanvasItem::TextureFilter get_texture_filter() const;
  323. void set_texture_repeat(CanvasItem::TextureRepeat p_repeat);
  324. CanvasItem::TextureRepeat get_texture_repeat() const;
  325. virtual int get_width() const override;
  326. virtual int get_height() const override;
  327. virtual bool is_pixel_opaque(int p_x, int p_y) const override;
  328. virtual bool has_alpha() const override;
  329. virtual Ref<Image> get_image() const override;
  330. virtual RID get_rid() const override;
  331. CanvasTexture();
  332. ~CanvasTexture();
  333. };
  334. #endif // CANVAS_ITEM_H