summary refs log tree commit diff stats
path: root/res/scripts/common.lua
diff options
context:
space:
mode:
Diffstat (limited to 'res/scripts/common.lua')
-rw-r--r--res/scripts/common.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 1d4879f..e355a32 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua
@@ -414,6 +414,15 @@ function SetAnimationSlowdown(spriteName, amount)
414 sprite.animSlowdown = amount 414 sprite.animSlowdown = amount
415end 415end
416 416
417--- Sets the opacity of the sprite when it is rendered.
418-- @param spriteName the alias of the sprite to modify
419-- @param amount a value from 0.0 to 1.0
420function SetOpacity(spriteName, amount)
421 local spriteId = getSpriteByAlias(spriteName)
422 local sprite = getSprite(spriteId)
423 sprite.opacity = amount
424end
425
417--- Sets the enclosure zone for a sprite. 426--- Sets the enclosure zone for a sprite.
418-- The sprite will be prevented from exiting the area defined by that zone. 427-- The sprite will be prevented from exiting the area defined by that zone.
419function AddEnclosureZone(spriteName, zone) 428function AddEnclosureZone(spriteName, zone)