summary refs log tree commit diff stats
path: root/res
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2021-07-05 10:07:32 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2021-07-05 10:07:32 -0400
commit132899d222f2c7d3542655b2332ed3574ffa9737 (patch)
tree4343a3bf439625767be6d61fe7b1282918f1b988 /res
parentcb32c362ce5db91e06dc8b281bcd02a4df2a1481 (diff)
downloadtanetane-132899d222f2c7d3542655b2332ed3574ffa9737.tar.gz
tanetane-132899d222f2c7d3542655b2332ed3574ffa9737.tar.bz2
tanetane-132899d222f2c7d3542655b2332ed3574ffa9737.zip
Added sprite opacity
Diffstat (limited to 'res')
-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)