diff options
Diffstat (limited to 'res/scripts/common.lua')
-rw-r--r-- | res/scripts/common.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index caab86a..f88c4c1 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua | |||
@@ -141,6 +141,29 @@ function StopShakingCamera() | |||
141 | effect():stopShakingCamera() | 141 | effect():stopShakingCamera() |
142 | end | 142 | end |
143 | 143 | ||
144 | function PanToSprite(spriteName, length) | ||
145 | local spriteId = getSpriteByAlias(spriteName) | ||
146 | camera():panToSprite(spriteId, length) | ||
147 | end | ||
148 | |||
149 | function WaitForPan() | ||
150 | while camera():isPanning() do | ||
151 | coroutine.yield() | ||
152 | end | ||
153 | end | ||
154 | |||
155 | function ReturnCamera(length) | ||
156 | local playerId = getPlayerSprite() | ||
157 | camera():panToSprite(playerId, length) | ||
158 | |||
159 | while camera():isPanning() do | ||
160 | coroutine.yield() | ||
161 | end | ||
162 | |||
163 | camera():setFollowingSprite(playerId) | ||
164 | camera():unlockCamera() | ||
165 | end | ||
166 | |||
144 | function SetPartyDirection(spriteId, direction) | 167 | function SetPartyDirection(spriteId, direction) |
145 | animation():setSpriteDirection(spriteId, direction) | 168 | animation():setSpriteDirection(spriteId, direction) |
146 | 169 | ||