This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fadeIn() now uses opacity to figure out the final opacity to fade into (
#844) * make fadeIn have a final opacity setting * fadeIn uses the opacity component to check what opacity its set to and fades into it * fix fadeIn to actually work and prep for push Changed fadeIn to use opacity so it can fade into 0.5 for example Changed Contributing.md because there was "" around linebreak style and that isnt correct Added fadeIn example so you can learn fadeIn Changed JSDoc to have a fadeIn example * fix issues from comments
- Loading branch information
Showing
5 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"collision", | ||
"gravity", | ||
"sprite", | ||
"fadeIn", | ||
"text", | ||
"audio", | ||
"level", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
kaboom() | ||
loadBean() | ||
|
||
// spawn a bean that takes a second to fade in | ||
const bean = add([ | ||
sprite("bean"), | ||
pos(120, 80), | ||
opacity(), // opacity() component gives it opacity which is required for fadeIn | ||
fadeIn(), // fadeIn() component makes it fade in | ||
]) | ||
|
||
// spawn another bean that takes 5 seconds to fade in halfway | ||
// SPOOKY! | ||
let spookyBean = add([ | ||
sprite("bean"), | ||
pos(240, 80), | ||
opacity(0.5), // opacity() component gives it opacity which is required for fadeIn (set to 0.5 so it will be half transparent) | ||
fadeIn(5), // fadeIn() component makes it fade in (set to 5 so that it takes 5 seconds to fade in) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters