class_randomnumbergenerator.rst 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_seed>` |
  16. +-----------------------+-----------------------------------------------+
  17. Methods
  18. -------
  19. +----------------------------+------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`float<class_float>` | :ref:`rand_range<class_RandomNumberGenerator_rand_range>` **(** :ref:`float<class_float>` from, :ref:`float<class_float>` to **)** |
  21. +----------------------------+------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`float<class_float>` | :ref:`randf<class_RandomNumberGenerator_randf>` **(** **)** |
  23. +----------------------------+------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`int<class_int>` | :ref:`randi<class_RandomNumberGenerator_randi>` **(** **)** |
  25. +----------------------------+------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`randomize<class_RandomNumberGenerator_randomize>` **(** **)** |
  27. +----------------------------+------------------------------------------------------------------------------------------------------------------------------------+
  28. Property Descriptions
  29. ---------------------
  30. .. _class_RandomNumberGenerator_seed:
  31. - :ref:`int<class_int>` **seed**
  32. +----------+-----------------+
  33. | *Setter* | set_seed(value) |
  34. +----------+-----------------+
  35. | *Getter* | get_seed() |
  36. +----------+-----------------+
  37. Method Descriptions
  38. -------------------
  39. .. _class_RandomNumberGenerator_rand_range:
  40. - :ref:`float<class_float>` **rand_range** **(** :ref:`float<class_float>` from, :ref:`float<class_float>` to **)**
  41. Generates pseudo-random float between ``from`` and ``to``.
  42. .. _class_RandomNumberGenerator_randf:
  43. - :ref:`float<class_float>` **randf** **(** **)**
  44. Generates pseudo-random float between '0.0' and '1.0'.
  45. .. _class_RandomNumberGenerator_randi:
  46. - :ref:`int<class_int>` **randi** **(** **)**
  47. Generates pseudo-random 32-bit integer between '0' and '4294967295'.
  48. .. _class_RandomNumberGenerator_randomize:
  49. - void **randomize** **(** **)**
  50. Setups a time-based seed to generator.