mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
87 lines
3.8 KiB
ReStructuredText
87 lines
3.8 KiB
ReStructuredText
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the RandomNumberGenerator.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_RandomNumberGenerator:
|
|
|
|
RandomNumberGenerator
|
|
=====================
|
|
|
|
**Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
|
|
|
|
**Category:** Core
|
|
|
|
Brief Description
|
|
-----------------
|
|
|
|
A class for generation pseudo-random numbers.
|
|
|
|
Properties
|
|
----------
|
|
|
|
+-----------------------+--------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`seed<class_RandomNumberGenerator_property_seed>` |
|
|
+-----------------------+--------------------------------------------------------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`randf<class_RandomNumberGenerator_method_randf>` **(** **)** |
|
|
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`randf_range<class_RandomNumberGenerator_method_randf_range>` **(** :ref:`float<class_float>` from, :ref:`float<class_float>` to **)** |
|
|
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`randi<class_RandomNumberGenerator_method_randi>` **(** **)** |
|
|
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`randi_range<class_RandomNumberGenerator_method_randi_range>` **(** :ref:`int<class_int>` from, :ref:`int<class_int>` to **)** |
|
|
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`randomize<class_RandomNumberGenerator_method_randomize>` **(** **)** |
|
|
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_RandomNumberGenerator_property_seed:
|
|
|
|
- :ref:`int<class_int>` **seed**
|
|
|
|
+----------+-----------------+
|
|
| *Setter* | set_seed(value) |
|
|
+----------+-----------------+
|
|
| *Getter* | get_seed() |
|
|
+----------+-----------------+
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_RandomNumberGenerator_method_randf:
|
|
|
|
- :ref:`float<class_float>` **randf** **(** **)**
|
|
|
|
Generates pseudo-random float between '0.0' and '1.0'.
|
|
|
|
.. _class_RandomNumberGenerator_method_randf_range:
|
|
|
|
- :ref:`float<class_float>` **randf_range** **(** :ref:`float<class_float>` from, :ref:`float<class_float>` to **)**
|
|
|
|
Generates pseudo-random float between ``from`` and ``to``.
|
|
|
|
.. _class_RandomNumberGenerator_method_randi:
|
|
|
|
- :ref:`int<class_int>` **randi** **(** **)**
|
|
|
|
Generates pseudo-random 32-bit unsigned integer between '0' and '4294967295'.
|
|
|
|
.. _class_RandomNumberGenerator_method_randi_range:
|
|
|
|
- :ref:`int<class_int>` **randi_range** **(** :ref:`int<class_int>` from, :ref:`int<class_int>` to **)**
|
|
|
|
Generates pseudo-random 32-bit signed integer between ``from`` and ``to``\ (inclusive).
|
|
|
|
.. _class_RandomNumberGenerator_method_randomize:
|
|
|
|
- void **randomize** **(** **)**
|
|
|
|
Setups a time-based seed to generator.
|
|
|