class_bool.rst 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_bool:
  4. bool
  5. ====
  6. **Category:** Built-In Types
  7. Brief Description
  8. -----------------
  9. Boolean built-in type
  10. Member Functions
  11. ----------------
  12. +--------------------------+-----------------------------------------------------------------------------+
  13. | :ref:`bool<class_bool>` | :ref:`bool<class_bool_bool>` **(** :ref:`int<class_int>` from **)** |
  14. +--------------------------+-----------------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`bool<class_bool_bool>` **(** :ref:`float<class_float>` from **)** |
  16. +--------------------------+-----------------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`bool<class_bool_bool>` **(** :ref:`String<class_string>` from **)** |
  18. +--------------------------+-----------------------------------------------------------------------------+
  19. Description
  20. -----------
  21. Boolean built-in type.
  22. Member Function Description
  23. ---------------------------
  24. .. _class_bool_bool:
  25. - :ref:`bool<class_bool>` **bool** **(** :ref:`int<class_int>` from **)**
  26. Cast an :ref:`int<class_int>` value to a boolean value, this method will return true if called with an integer value different to 0 and false in other case.
  27. .. _class_bool_bool:
  28. - :ref:`bool<class_bool>` **bool** **(** :ref:`float<class_float>` from **)**
  29. Cast a :ref:`float<class_float>` value to a boolean value, this method will return true if called with a floating point value different to 0 and false in other case.
  30. .. _class_bool_bool:
  31. - :ref:`bool<class_bool>` **bool** **(** :ref:`String<class_string>` from **)**
  32. Cast a :ref:`String<class_string>` value to a boolean value, this method will return true if called with a non empty string and false in other case. Examples: ``bool('False')`` returns true, ``bool('')``. returns false