Skip to content
0.2.0-dev Download ZIP
62 lines ·4.0 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="GradientTexture2D" 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 creates a pattern with colors obtained from a [Gradient].
5 </brief_description>
6 <description>
7 A 2D texture that obtains colors from a [Gradient] to fill the texture data. This texture is able to transform a color transition into different patterns such as a linear or a radial gradient. The texture is filled by interpolating colors starting from [member fill_from] to [member fill_to] offsets by default, but the gradient fill can be repeated to cover the entire texture.
8 The gradient is sampled individually for each pixel so it does not necessarily represent an exact copy of the gradient (see [member width] and [member height]). See also [GradientTexture1D], [CurveTexture] and [CurveXYZTexture].
9 </description>
10 <tutorials>
11 </tutorials>
12 <members>
13 <member name="fill" type="int" setter="set_fill" getter="get_fill" enum="GradientTexture2D.Fill" default="0">
14 The gradient's fill type.
15 </member>
16 <member name="fill_from" type="Vector2" setter="set_fill_from" getter="get_fill_from" default="Vector2(0, 0)">
17 The initial offset used to fill the texture specified in UV coordinates.
18 </member>
19 <member name="fill_to" type="Vector2" setter="set_fill_to" getter="get_fill_to" default="Vector2(1, 0)">
20 The final offset used to fill the texture specified in UV coordinates.
21 </member>
22 <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient">
23 The [Gradient] used to fill the texture.
24 </member>
25 <member name="height" type="int" setter="set_height" getter="get_height" default="64">
26 The number of vertical color samples that will be obtained from the [Gradient], which also represents the texture's height.
27 </member>
28 <member name="repeat" type="int" setter="set_repeat" getter="get_repeat" enum="GradientTexture2D.Repeat" default="0">
29 The gradient's repeat type.
30 </member>
31 <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" />
32 <member name="use_hdr" type="bool" setter="set_use_hdr" getter="is_using_hdr" default="false">
33 If [code]true[/code], the generated texture will support high dynamic range ([constant Image.FORMAT_RGBAF] format). This allows for glow effects to work if [member Environment.glow_enabled] is [code]true[/code]. If [code]false[/code], the generated texture will use low dynamic range; overbright colors will be clamped ([constant Image.FORMAT_RGBA8] format).
34 </member>
35 <member name="width" type="int" setter="set_width" getter="get_width" default="64">
36 The number of horizontal color samples that will be obtained from the [Gradient], which also represents the texture's width.
37 </member>
38 </members>
39 <constants>
40 <constant name="FILL_LINEAR" value="0" enum="Fill">
41 The colors are linearly interpolated in a straight line.
42 </constant>
43 <constant name="FILL_RADIAL" value="1" enum="Fill">
44 The colors are linearly interpolated in a circular pattern.
45 </constant>
46 <constant name="FILL_SQUARE" value="2" enum="Fill">
47 The colors are linearly interpolated in a square pattern.
48 </constant>
49 <constant name="FILL_CONIC" value="3" enum="Fill">
50 The colors are linearly interpolated in a cone pattern.
51 </constant>
52 <constant name="REPEAT_NONE" value="0" enum="Repeat">
53 The gradient fill is restricted to the range defined by [member fill_from] to [member fill_to] offsets.
54 </constant>
55 <constant name="REPEAT" value="1" enum="Repeat">
56 The texture is filled starting from [member fill_from] to [member fill_to] offsets, repeating the same pattern in both directions.
57 </constant>
58 <constant name="REPEAT_MIRROR" value="2" enum="Repeat">
59 The texture is filled starting from [member fill_from] to [member fill_to] offsets, mirroring the pattern in both directions.
60 </constant>
61 </constants>
62</class>