Last active
December 7, 2020 13:41
-
-
Save 0xf0f0f0/b54ddeb58b8a82f5cd919fa1c1954d8f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const delay = (game, delay = 1) => game.add.tween(this) | |
| .to({}, delay, null, true).onComplete; | |
| const makeText = (game, props, anchor = {x: .5, y: .5}) => { | |
| const {value, styles} = props; | |
| const {x, y} = anchor; | |
| const text = game.make.text(0, 0, value, styles); | |
| text.anchor.set(x, y); | |
| return text; | |
| }; | |
| const createCurtain = (game, color, alpha) => { | |
| const graphics = game.make.graphics(); | |
| graphics.beginFill(color, alpha); | |
| graphics.drawRect(0, 0, 960, 960); | |
| graphics.endFill(); | |
| return graphics; | |
| }; | |
| export { | |
| delay, createCurtain, | |
| makeText | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment