A script to simulate confetti particles 🎉.
Name | Type | Default |
---|---|---|
emitting | bool |
false |
type | int |
0 |
amount | int |
150 |
random_amount | bool |
true |
size | float |
3.0 |
random_size | bool |
true |
visibility_rect | Rect2 |
Rect2(0.0, 0.0, 1024.0, 600.0) |
colors | Array |
[Color("#008751"),Color("#00e436"),Color("#29adff"),Color("#7e2553"),Color("#83769c"),Color("#ff004d"),Color("#ff77a8"),Color("#ffa300"),Color("#ffec27")] |
random_position | bool |
true |
one_shot | bool |
false |
fade | bool |
true |
timer_wait_time | float |
1.0 |
export (bool) var emitting = false setget _set_emitting
If true
, particles are being emitted.
Name | Type | Default | Setter |
---|---|---|---|
emitting |
bool |
false |
_set_emitting |
export (int, "Square", "Circle") var type = 0
The type of particles:
0 (Square)
.1 (Circle)
.
Name | Type | Default |
---|---|---|
type |
int |
0 |
export (int) var amount = 150
The number of particles.
Name | Type | Default |
---|---|---|
amount |
int |
150 |
export (bool) var random_amount = true
If true
, the number of particles can be a random number between amount / 2
and amount * 2
.
If false
, the number of particles will be the exact number in amount.
Name | Type | Default |
---|---|---|
random_amount |
bool |
true |
export (float) var size = 3.0
The size of the particles.
If the particles are squares, size
is the length of their sides. If the particles are circles, size
is their radius.
Name | Type | Default |
---|---|---|
size |
float |
3.0 |
export (bool) var random_size = true
If true
, the size of the particles can be a random number between size / 2
and size * 2
.
If false
, the size of the particles will be the exact number in size.
Name | Type | Default |
---|---|---|
random_size |
bool |
true |
export (Rect2) var visibility_rect = Rect2(0.0, 0.0, 1024.0, 600.0)
Controls the visibility of the particles.
Name | Type | Default |
---|---|---|
visibility_rect |
Rect2 |
Rect2(0.0, 0.0, 1024.0, 600.0) |
export (Array) var colors = [Color("#008751"),Color("#00e436"),Color("#29adff"),Color("#7e2553"),Color("#83769c"),Color("#ff004d"),Color("#ff77a8"),Color("#ffa300"),Color("#ffec27")]
The color/s of the particles.
Name | Type | Default |
---|---|---|
colors |
Array |
[Color("#008751"),Color("#00e436"),Color("#29adff"),Color("#7e2553"),Color("#83769c"),Color("#ff004d"),Color("#ff77a8"),Color("#ffa300"),Color("#ffec27")] |
export (bool) var random_position = true
If true
, the initial position of the particles can be a random position in visibility_rect.
If false
, the initial position of the particles will be Vector(0, 0)
.
Name | Type | Default |
---|---|---|
random_position |
bool |
true |
export (bool) var one_shot = false
If true
, only one emission cycle occurs.
Name | Type | Default |
---|---|---|
one_shot |
bool |
false |
export (bool) var fade = true
If true
, the particles will gradually fade.
If false
, the particles will end abruptly.
Name | Type | Default |
---|---|---|
fade |
bool |
true |
export (float) var timer_wait_time = 1.0
The duration (in seconds) of the emission cycle.
Name | Type | Default |
---|---|---|
timer_wait_time |
float |
1.0 |
See CHANGELOG.
- hiulit
Feel free to:
- Open an issue if you find a bug.
- Create a pull request if you have a new cool feature to add to the project.
If you find this project helpful, please consider supporting it through any size donations to help make it better.
If you can't, consider sharing it with the world...
... or giving it a star.
Thank you very much!
- Source code: MIT License.
- Documentation (GDScriptify): MIT License.
Powered by GDScriptify.