Random global functions
- Source
Members
(static) randSeed :Number
Seed used by the randSeeded function
Type:
- Number
- Default Value
- 1
- Source
Methods
(static) rand(valueAopt, valueBopt) → {Number}
Returns a random value between the two values passed in
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
valueA | Number | <optional> | 1 | |
valueB | Number | <optional> | 0 |
- Source
Returns:
- Type:
- Number
(static) randColor(colorAopt, colorBopt, linearopt) → {Color}
Returns a random color between the two passed in colors, combine components if linear
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
colorA | Color | <optional> | Color() | |
colorB | Color | <optional> | Color(0,0,0,1) | |
linear | Boolean | <optional> |
- Source
Returns:
- Type:
- Color
(static) randInCircle(radiusopt, minRadiusopt) → {Vector2}
Returns a random Vector2 within a circular shape
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
radius | Number | <optional> | 1 | |
minRadius | Number | <optional> | 0 |
- Source
Returns:
- Type:
- Vector2
(static) randInt(valueAopt, valueBopt) → {Number}
Returns a floored random value the two values passed in
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
valueA | Number | <optional> | 1 | |
valueB | Number | <optional> | 0 |
- Source
Returns:
- Type:
- Number
(static) randSeeded(valueAopt, valueBopt) → {Number}
Returns a seeded random value between the two values passed in using randSeed
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
valueA | Number | <optional> | 1 | |
valueB | Number | <optional> | 0 |
- Source
Returns:
- Type:
- Number
(static) randSign() → {Number}
Randomly returns either -1 or 1
- Source
Returns:
- Type:
- Number
(static) randVector(lengthopt) → {Vector2}
Returns a random Vector2 with the passed in length
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
length | Number | <optional> | 1 |
- Source
Returns:
- Type:
- Vector2
(static) setRandSeed(seed)
Set seed used by the randSeeded function, should not be 0
Parameters:
Name | Type | Description |
---|---|---|
seed | Number |
- Source