0.2.0-dev Download ZIP
38 lines ·3.6 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="CanvasTexture" inherits="Texture2D" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Texture with optional normal and specular maps for use in 2D rendering. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | [CanvasTexture] is an alternative to [ImageTexture] for 2D rendering. It allows using normal maps and specular maps in any node that inherits from [CanvasItem]. [CanvasTexture] also allows overriding the texture's filter and repeat mode independently of the node's properties (or the project settings). |
| 8 | [b]Note:[/b] [CanvasTexture] cannot be used in 3D. It will not display correctly when applied to any [VisualInstance3D], such as [Sprite3D] or [Decal]. For physically-based materials in 3D, use [BaseMaterial3D] instead. |
| 9 | </description> |
| 10 | <tutorials> |
| 11 | <link title="2D Lights and Shadows">$DOCS_URL/tutorials/2d/2d_lights_and_shadows.html</link> |
| 12 | </tutorials> |
| 13 | <members> |
| 14 | <member name="diffuse_texture" type="Texture2D" setter="set_diffuse_texture" getter="get_diffuse_texture"> |
| 15 | The diffuse (color) texture to use. This is the main texture you want to set in most cases. |
| 16 | </member> |
| 17 | <member name="normal_texture" type="Texture2D" setter="set_normal_texture" getter="get_normal_texture"> |
| 18 | The normal map texture to use. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. |
| 19 | [b]Note:[/b] Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. |
| 20 | </member> |
| 21 | <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> |
| 22 | <member name="specular_color" type="Color" setter="set_specular_color" getter="get_specular_color" default="Color(1, 1, 1, 1)"> |
| 23 | The multiplier for specular reflection colors. The [Light2D]'s color is also taken into account when determining the reflection color. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. |
| 24 | </member> |
| 25 | <member name="specular_shininess" type="float" setter="set_specular_shininess" getter="get_specular_shininess" default="1.0"> |
| 26 | The specular exponent for [Light2D] specular reflections. Higher values result in a more glossy/"wet" look, with reflections becoming more localized and less visible overall. The default value of [code]1.0[/code] disables specular reflections entirely. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. |
| 27 | </member> |
| 28 | <member name="specular_texture" type="Texture2D" setter="set_specular_texture" getter="get_specular_texture"> |
| 29 | The specular map to use for [Light2D] specular reflections. This should be a grayscale or colored texture, with brighter areas resulting in a higher [member specular_shininess] value. Using a colored [member specular_texture] allows controlling specular shininess on a per-channel basis. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. |
| 30 | </member> |
| 31 | <member name="texture_filter" type="int" setter="set_texture_filter" getter="get_texture_filter" enum="CanvasItem.TextureFilter" default="0"> |
| 32 | The texture filtering mode to use when drawing this [CanvasTexture]. |
| 33 | </member> |
| 34 | <member name="texture_repeat" type="int" setter="set_texture_repeat" getter="get_texture_repeat" enum="CanvasItem.TextureRepeat" default="0"> |
| 35 | The texture repeat mode to use when drawing this [CanvasTexture]. |
| 36 | </member> |
| 37 | </members> |
| 38 | </class> |