.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_Texture: Texture ======= **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Inherited By:** :ref:`CurveTexture`, :ref:`AtlasTexture`, :ref:`StreamTexture`, :ref:`GradientTexture`, :ref:`ViewportTexture`, :ref:`ImageTexture`, :ref:`LargeTexture` **Category:** Core Brief Description ----------------- Texture for 2D and 3D. Member Functions ---------------- +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw` **(** :ref:`RID` canvas_item, :ref:`Vector2` pos, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=null, :ref:`Texture` normal_map=null **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_rect` **(** :ref:`RID` canvas_item, :ref:`Rect2` rect, :ref:`bool` tile, :ref:`Color` modulate=null, :ref:`bool` transpose=null, :ref:`Texture` normal_map=null **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`draw_rect_region` **(** :ref:`RID` canvas_item, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=null, :ref:`Texture` normal_map=null, :ref:`bool` clip_uv=null **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`get_data` **(** **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_flags` **(** **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_height` **(** **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_size` **(** **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_width` **(** **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_alpha` **(** **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_flags` **(** :ref:`int` flags **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Numeric Constants ----------------- - **FLAG_MIPMAPS** = **1** --- Generate mipmaps, to enable smooth zooming out of the texture. - **FLAG_REPEAT** = **2** --- Repeat (instead of clamp to edge). - **FLAG_FILTER** = **4** --- Turn on magnifying filter, to enable smooth zooming in of the texture. - **FLAG_VIDEO_SURFACE** = **4096** --- Texture is a video surface. - **FLAGS_DEFAULT** = **7** --- Default flags. Generate mipmaps, repeat, and filter are enabled. - **FLAG_ANISOTROPIC_FILTER** = **8** - **FLAG_CONVERT_TO_LINEAR** = **16** - **FLAG_MIRRORED_REPEAT** = **32** Description ----------- A texture works by registering an image in the video hardware, which then can be used in 3D models or 2D :ref:`Sprite` or GUI :ref:`Control`. Member Function Description --------------------------- .. _class_Texture_draw: - void **draw** **(** :ref:`RID` canvas_item, :ref:`Vector2` pos, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=null, :ref:`Texture` normal_map=null **)** const .. _class_Texture_draw_rect: - void **draw_rect** **(** :ref:`RID` canvas_item, :ref:`Rect2` rect, :ref:`bool` tile, :ref:`Color` modulate=null, :ref:`bool` transpose=null, :ref:`Texture` normal_map=null **)** const .. _class_Texture_draw_rect_region: - void **draw_rect_region** **(** :ref:`RID` canvas_item, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=null, :ref:`Texture` normal_map=null, :ref:`bool` clip_uv=null **)** const .. _class_Texture_get_data: - :ref:`Image` **get_data** **(** **)** const .. _class_Texture_get_flags: - :ref:`int` **get_flags** **(** **)** const Return the current texture flags. .. _class_Texture_get_height: - :ref:`int` **get_height** **(** **)** const Return the texture height. .. _class_Texture_get_size: - :ref:`Vector2` **get_size** **(** **)** const Return the texture size. .. _class_Texture_get_width: - :ref:`int` **get_width** **(** **)** const Return the texture width. .. _class_Texture_has_alpha: - :ref:`bool` **has_alpha** **(** **)** const .. _class_Texture_set_flags: - void **set_flags** **(** :ref:`int` flags **)** Change the texture flags.