summaryrefslogtreecommitdiff
path: root/doc/classes/Decal.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/Decal.xml')
-rw-r--r--doc/classes/Decal.xml24
1 files changed, 20 insertions, 4 deletions
diff --git a/doc/classes/Decal.xml b/doc/classes/Decal.xml
index f9baa3b09a..8107d97b67 100644
--- a/doc/classes/Decal.xml
+++ b/doc/classes/Decal.xml
@@ -20,10 +20,18 @@
Returns the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
For example, instead of [code]albedo_tex = $Decal.get_texture(Decal.TEXTURE_ALBEDO)[/code], use [code]albedo_tex = $Decal.texture_albedo[/code].
One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
for i in Decal.TEXTURE_MAX:
$NewDecal.set_texture(i, $OldDecal.get_texture(i))
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ for (int i = 0; i < (int)Decal.DecalTexture.Max; i++)
+ {
+ GetNode<Decal>("NewDecal").SetTexture(i, GetNode<Decal>("OldDecal").GetTexture(i));
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="set_texture">
@@ -37,10 +45,18 @@
Sets the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly.
For example, instead of [code]$Decal.set_texture(Decal.TEXTURE_ALBEDO, albedo_tex)[/code], use [code]$Decal.texture_albedo = albedo_tex[/code].
One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example:
- [codeblock]
+ [codeblocks]
+ [gdscript]
for i in Decal.TEXTURE_MAX:
$NewDecal.set_texture(i, $OldDecal.get_texture(i))
- [/codeblock]
+ [/gdscript]
+ [csharp]
+ for (int i = 0; i &lt; (int)Decal.DecalTexture.Max; i++)
+ {
+ GetNode&lt;Decal&gt;("NewDecal").SetTexture(i, GetNode&lt;Decal&gt;("OldDecal").GetTexture(i));
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
</methods>