1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add a type conversion method to Variant Utility and expose to scripting

This commit is contained in:
Aaron Franke
2022-12-14 15:16:43 -06:00
parent 8c1817f755
commit 6f7eccc758
4 changed files with 108 additions and 1 deletions

View File

@@ -57,11 +57,12 @@
[/codeblock]
</description>
</method>
<method name="convert">
<method name="convert" is_deprecated="true">
<return type="Variant" />
<param index="0" name="what" type="Variant" />
<param index="1" name="type" type="int" />
<description>
[i]Deprecated.[/i] Use [method @GlobalScope.type_convert] instead.
Converts [param what] to [param type] in the best way possible. The [param type] uses the [enum Variant.Type] values.
[codeblock]
var a = [4, 2.5, 1.2]