Skip to content
0.2.0-dev Download ZIP
91 lines ·4.9 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="DrawableTexture2D" inherits="Texture2D" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 A 2D texture that supports drawing to itself via Blit calls.
5 </brief_description>
6 <description>
7 A 2D texture that can be modified via blit calls, copying from a target texture to itself. Primarily intended to be managed in code, a user must call [method setup] to initialize the state before drawing. Each [method blit_rect] call takes at least a rectangle, the area to draw to, and another texture, what to be drawn. The draw calls use a Texture_Blit Shader to process and calculate the result, pixel by pixel. Users can supply their own ShaderMaterial with custom Texture_Blit shaders for more complex behaviors.
8 </description>
9 <tutorials>
10 </tutorials>
11 <methods>
12 <method name="blit_rect" experimental="">
13 <return type="void" />
14 <param index="0" name="rect" type="Rect2i" />
15 <param index="1" name="source" type="Texture2D" />
16 <param index="2" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
17 <param index="3" name="mipmap" type="int" default="0" />
18 <param index="4" name="material" type="Material" default="null" />
19 <description>
20 Draws to given [param rect] on this texture by copying from the given [param source]. A [param modulate] color can be passed in for the shader to use, but defaults to White. The [param mipmap] value can specify a draw to a lower mipmap level. The [param material] parameter can take a ShaderMaterial with a TextureBlit Shader for custom drawing behavior.
21 </description>
22 </method>
23 <method name="blit_rect_multi" experimental="">
24 <return type="void" />
25 <param index="0" name="rect" type="Rect2i" />
26 <param index="1" name="sources" type="Texture2D[]" />
27 <param index="2" name="extra_targets" type="DrawableTexture2D[]" />
28 <param index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
29 <param index="4" name="mipmap" type="int" default="0" />
30 <param index="5" name="material" type="Material" default="null" />
31 <description>
32 Draws to the given [param rect] on this texture, as well as on up to 3 DrawableTexture [param extra_targets]. All [param extra_targets] must be the same size and DrawableFormat as the original target, otherwise the Shader may fail. Expects up to 4 Texture [param sources], but will replace missing [param sources] with default Black Textures.
33 </description>
34 </method>
35 <method name="generate_mipmaps">
36 <return type="void" />
37 <description>
38 Re-calculates the mipmaps for this texture on demand.
39 </description>
40 </method>
41 <method name="get_use_mipmaps" qualifiers="const">
42 <return type="bool" />
43 <description>
44 Returns [code]true[/code] if mipmaps are set to be used on this DrawableTexture.
45 </description>
46 </method>
47 <method name="set_format">
48 <return type="void" />
49 <param index="0" name="format" type="int" enum="DrawableTexture2D.DrawableFormat" />
50 <description>
51 Sets the format of this DrawableTexture.
52 </description>
53 </method>
54 <method name="set_use_mipmaps">
55 <return type="void" />
56 <param index="0" name="mipmaps" type="bool" />
57 <description>
58 Sets if mipmaps should be used on this DrawableTexture.
59 </description>
60 </method>
61 <method name="setup" experimental="">
62 <return type="void" />
63 <param index="0" name="width" type="int" />
64 <param index="1" name="height" type="int" />
65 <param index="2" name="format" type="int" enum="DrawableTexture2D.DrawableFormat" />
66 <param index="3" name="color" type="Color" default="Color(1, 1, 1, 1)" />
67 <param index="4" name="use_mipmaps" type="bool" default="false" />
68 <description>
69 Initializes the DrawableTexture to a White texture of the given [param width], [param height], and [param format].
70 </description>
71 </method>
72 </methods>
73 <members>
74 <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" />
75 </members>
76 <constants>
77 <constant name="DRAWABLE_FORMAT_RGBA8" value="0" enum="DrawableFormat">
78 OpenGL texture format RGBA with four components, each with a bitdepth of 8.
79 </constant>
80 <constant name="DRAWABLE_FORMAT_RGBA8_SRGB" value="1" enum="DrawableFormat">
81 OpenGL texture format RGBA with four components, each with a bitdepth of 8.
82 When drawn to, a linear to sRGB color encoding conversion is performed.
83 </constant>
84 <constant name="DRAWABLE_FORMAT_RGBAH" value="2" enum="DrawableFormat">
85 OpenGL texture format GL_RGBA16F where there are four components, each a 16-bit "half-precision" floating-point value.
86 </constant>
87 <constant name="DRAWABLE_FORMAT_RGBAF" value="3" enum="DrawableFormat">
88 OpenGL texture format GL_RGBA32F where there are four components, each a 32-bit floating-point value.
89 </constant>
90 </constants>
91</class>