class_randomnumbergenerator.rst 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the RandomNumberGenerator.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_RandomNumberGenerator:
  5. RandomNumberGenerator
  6. =====================
  7. **Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. A class for generation pseudo-random numbers.
  12. Properties
  13. ----------
  14. +-----------------------+--------------------------------------------------------+
  15. | :ref:`int<class_int>` | :ref:`seed<class_RandomNumberGenerator_property_seed>` |
  16. +-----------------------+--------------------------------------------------------+
  17. Methods
  18. -------
  19. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`float<class_float>` | :ref:`randf<class_RandomNumberGenerator_method_randf>` **(** **)** |
  21. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`float<class_float>` | :ref:`randf_range<class_RandomNumberGenerator_method_randf_range>` **(** :ref:`float<class_float>` from, :ref:`float<class_float>` to **)** |
  23. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`int<class_int>` | :ref:`randi<class_RandomNumberGenerator_method_randi>` **(** **)** |
  25. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`int<class_int>` | :ref:`randi_range<class_RandomNumberGenerator_method_randi_range>` **(** :ref:`int<class_int>` from, :ref:`int<class_int>` to **)** |
  27. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`randomize<class_RandomNumberGenerator_method_randomize>` **(** **)** |
  29. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
  30. Property Descriptions
  31. ---------------------
  32. .. _class_RandomNumberGenerator_property_seed:
  33. - :ref:`int<class_int>` **seed**
  34. +----------+-----------------+
  35. | *Setter* | set_seed(value) |
  36. +----------+-----------------+
  37. | *Getter* | get_seed() |
  38. +----------+-----------------+
  39. Method Descriptions
  40. -------------------
  41. .. _class_RandomNumberGenerator_method_randf:
  42. - :ref:`float<class_float>` **randf** **(** **)**
  43. Generates pseudo-random float between '0.0' and '1.0'.
  44. .. _class_RandomNumberGenerator_method_randf_range:
  45. - :ref:`float<class_float>` **randf_range** **(** :ref:`float<class_float>` from, :ref:`float<class_float>` to **)**
  46. Generates pseudo-random float between ``from`` and ``to``.
  47. .. _class_RandomNumberGenerator_method_randi:
  48. - :ref:`int<class_int>` **randi** **(** **)**
  49. Generates pseudo-random 32-bit unsigned integer between '0' and '4294967295'.
  50. .. _class_RandomNumberGenerator_method_randi_range:
  51. - :ref:`int<class_int>` **randi_range** **(** :ref:`int<class_int>` from, :ref:`int<class_int>` to **)**
  52. Generates pseudo-random 32-bit signed integer between ``from`` and ``to``\ (inclusive).
  53. .. _class_RandomNumberGenerator_method_randomize:
  54. - void **randomize** **(** **)**
  55. Setups a time-based seed to generator.