1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-22 00:21:32 +00:00

Changed fadeTime naming and documentation

This commit is contained in:
Harley White 2021-05-15 15:11:10 -04:00
parent 368a89452c
commit 3dc9315a3a
2 changed files with 5 additions and 5 deletions

View file

@ -23,8 +23,8 @@ Features can be functions or constant. These features will be called when each p
All distances are in pixels and angles are in degrees, with 0 being up and going clockwise.
- time: The amount of time, in seconds, that the particle will last. Default is 3.
- fadeTime: The amount of seconds that fading out at the end should take (part of the total lifetime). Default is 1.
- fadeTime: The amount of seconds that fading in should take (part of the total lifetime). Default is 0.
- fadeOutTime: The amount of seconds that fading out at the end should take (part of the total lifetime). Default is 1.
- fadeInTime: The amount of seconds that fading in should take (part of the total lifetime). Default is 0.
- image: The image the particle should display. `""` will display no image. Default is a generic particle.
- text: Displays text on the particle. Can use basic HTML.

View file

@ -82,7 +82,7 @@ function getNewParticle() {
yVel: 0,
rotation: 0,
gravity: 0,
fadeTime: 1,
fadeOutTime: 1,
fadeInTimer: 0,
fadeIn: 0,
}
@ -94,8 +94,8 @@ function updateMouse(event) {
}
function getOpacity(particle) {
if ((particle.time < particle.fadeTime) && particle.fadeTime)
return particle.time / particle.fadeTime
if ((particle.time < particle.fadeOutTime) && particle.fadeOutTime)
return particle.time / particle.fadeOutTime
if (particle.fadeInTimer > 0)
return 1 - (particle.fadeInTimer / particle.fadeInTime)