diff options
Diffstat (limited to 'res/scripts')
-rw-r--r-- | res/scripts/common.lua | 9 |
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 |
415 | end | 415 | end |
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 | ||
420 | function SetOpacity(spriteName, amount) | ||
421 | local spriteId = getSpriteByAlias(spriteName) | ||
422 | local sprite = getSprite(spriteId) | ||
423 | sprite.opacity = amount | ||
424 | end | ||
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. |
419 | function AddEnclosureZone(spriteName, zone) | 428 | function AddEnclosureZone(spriteName, zone) |