From d983ef6b8d66d916ed7502cf6d35b573c5366257 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 5 Jul 2021 10:39:06 -0400 Subject: Added fading in/out sprites --- res/scripts/common.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'res/scripts/common.lua') 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) sprite.opacity = amount end +--- Fades out the given sprite. +function FadeOutSprite(spriteName) + local spriteId = getSpriteByAlias(spriteName) + local sprite = getSprite(spriteId) + sprite.shouldBeFadedIn = false +end + +--- Fades out the given sprite. +function FadeInSprite(spriteName) + local spriteId = getSpriteByAlias(spriteName) + local sprite = getSprite(spriteId) + sprite.shouldBeFadedIn = true +end + --- Sets the enclosure zone for a sprite. -- The sprite will be prevented from exiting the area defined by that zone. function AddEnclosureZone(spriteName, zone) -- cgit 1.4.1