diff options
Diffstat (limited to 'doc/classes/Engine.xml')
-rw-r--r-- | doc/classes/Engine.xml | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index 297cccaaac..fab8512e4a 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -117,12 +117,24 @@ [code]year[/code] - Holds the year the version was released in as an int [code]string[/code] - [code]major[/code] + [code]minor[/code] + [code]patch[/code] + [code]status[/code] + [code]build[/code] in a single String The [code]hex[/code] value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be [code]0x03010C[/code]. [b]Note:[/b] It's still an int internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for easy version comparisons from code: - [codeblock] + [codeblocks] + [gdscript] if Engine.get_version_info().hex >= 0x030200: # Do things specific to version 3.2 or later else: # Do things specific to versions before 3.2 - [/codeblock] + [/gdscript] + [csharp] + if ((int)Engine.GetVersionInfo()["hex"] >= 0x030200) + { + // Do things specific to version 3.2 or later + } + else + { + // Do things specific to versions before 3.2 + } + [/csharp] + [/codeblocks] </description> </method> <method name="has_singleton" qualifiers="const"> |