Files
godot-docs/classes/class_int.rst
Rémi Verschelde ab3f908221 classref: Add property overview and setter/getter like in editor docs
Output from godotengine/godot#22013.
Fixes #1729.
2018-09-13 11:06:52 +02:00

54 lines
2.0 KiB
ReStructuredText

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the int.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
.. _class_int:
int
===
**Category:** Built-In Types
Brief Description
-----------------
Integer built-in type.
Methods
-------
+------------------------+------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`int<class_int_int>` **(** :ref:`bool<class_bool>` from **)** |
+------------------------+------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`int<class_int_int>` **(** :ref:`float<class_float>` from **)** |
+------------------------+------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`int<class_int_int>` **(** :ref:`String<class_String>` from **)** |
+------------------------+------------------------------------------------------------------------+
Description
-----------
Integer built-in type.
Method Descriptions
-------------------
.. _class_int_int:
- :ref:`int<class_int>` **int** **(** :ref:`bool<class_bool>` from **)**
Cast a :ref:`bool<class_bool>` value to an integer value, ``int(true)`` will be equals to 1 and ``int(false)`` will be equals to 0.
.. _class_int_int:
- :ref:`int<class_int>` **int** **(** :ref:`float<class_float>` from **)**
Cast a float value to an integer value, this method simply removes the number fractions, so for example ``int(2.7)`` will be equals to 2, ``int(.1)`` will be equals to 0 and ``int(-2.7)`` will be equals to -2.
.. _class_int_int:
- :ref:`int<class_int>` **int** **(** :ref:`String<class_String>` from **)**
Cast a :ref:`String<class_String>` value to an integer value, this method is an integer parser from a string, so calling this method with an invalid integer string will return 0, a valid string will be something like ``'1.7'``. This method will ignore all non-number characters, so calling ``int('1e3')`` will return 13.