diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2021-07-05 10:39:06 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2021-07-05 10:39:06 -0400 |
| commit | d983ef6b8d66d916ed7502cf6d35b573c5366257 (patch) | |
| tree | 2a98734180fc64f66a8623dc5c0d70b178e7b5af /res | |
| parent | 35fffb8cf13258a4ff36a3bf56751e106c954a71 (diff) | |
| download | tanetane-d983ef6b8d66d916ed7502cf6d35b573c5366257.tar.gz tanetane-d983ef6b8d66d916ed7502cf6d35b573c5366257.tar.bz2 tanetane-d983ef6b8d66d916ed7502cf6d35b573c5366257.zip | |
Added fading in/out sprites
Diffstat (limited to 'res')
| -rw-r--r-- | res/scripts/common.lua | 14 |
1 files changed, 14 insertions, 0 deletions
| diff --git a/res/scripts/common.lua b/res/scripts/common.lua index e355a32..2e95f26 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua | |||
| @@ -423,6 +423,20 @@ function SetOpacity(spriteName, amount) | |||
| 423 | sprite.opacity = amount | 423 | sprite.opacity = amount |
| 424 | end | 424 | end |
| 425 | 425 | ||
| 426 | --- Fades out the given sprite. | ||
| 427 | function FadeOutSprite(spriteName) | ||
| 428 | local spriteId = getSpriteByAlias(spriteName) | ||
| 429 | local sprite = getSprite(spriteId) | ||
| 430 | sprite.shouldBeFadedIn = false | ||
| 431 | end | ||
| 432 | |||
| 433 | --- Fades out the given sprite. | ||
| 434 | function FadeInSprite(spriteName) | ||
| 435 | local spriteId = getSpriteByAlias(spriteName) | ||
| 436 | local sprite = getSprite(spriteId) | ||
| 437 | sprite.shouldBeFadedIn = true | ||
| 438 | end | ||
| 439 | |||
| 426 | --- Sets the enclosure zone for a sprite. | 440 | --- Sets the enclosure zone for a sprite. |
| 427 | -- The sprite will be prevented from exiting the area defined by that zone. | 441 | -- The sprite will be prevented from exiting the area defined by that zone. |
| 428 | function AddEnclosureZone(spriteName, zone) | 442 | function AddEnclosureZone(spriteName, zone) |
