diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2021-07-05 10:07:32 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2021-07-05 10:07:32 -0400 |
commit | 132899d222f2c7d3542655b2332ed3574ffa9737 (patch) | |
tree | 4343a3bf439625767be6d61fe7b1282918f1b988 /res/scripts | |
parent | cb32c362ce5db91e06dc8b281bcd02a4df2a1481 (diff) | |
download | tanetane-132899d222f2c7d3542655b2332ed3574ffa9737.tar.gz tanetane-132899d222f2c7d3542655b2332ed3574ffa9737.tar.bz2 tanetane-132899d222f2c7d3542655b2332ed3574ffa9737.zip |
Added sprite opacity
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) |