diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-16 22:03:10 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-16 22:03:10 -0500 |
| commit | a645524d19bb9183d4eece72bf8945bba4bed3a0 (patch) | |
| tree | ca45cb80f73def5bd6bd8d7ec46bb90c826be848 /src/script_system.cpp | |
| parent | c5a96f0ee23a3dbe1a6dab0a1062cf25b7a2aba4 (diff) | |
| download | tanetane-a645524d19bb9183d4eece72bf8945bba4bed3a0.tar.gz tanetane-a645524d19bb9183d4eece72bf8945bba4bed3a0.tar.bz2 tanetane-a645524d19bb9183d4eece72bf8945bba4bed3a0.zip | |
Added scriptable camera panning
Diffstat (limited to 'src/script_system.cpp')
| -rw-r--r-- | src/script_system.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
| diff --git a/src/script_system.cpp b/src/script_system.cpp index cbbd473..3ac04ac 100644 --- a/src/script_system.cpp +++ b/src/script_system.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include "character_system.h" | 6 | #include "character_system.h" |
| 7 | #include "transform_system.h" | 7 | #include "transform_system.h" |
| 8 | #include "effect_system.h" | 8 | #include "effect_system.h" |
| 9 | #include "camera_system.h" | ||
| 9 | #include "vector.h" | 10 | #include "vector.h" |
| 10 | 11 | ||
| 11 | ScriptSystem::ScriptSystem(Game& game) : game_(game) { | 12 | ScriptSystem::ScriptSystem(Game& game) : game_(game) { |
| @@ -63,6 +64,13 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { | |||
| 63 | "shakeCamera", &EffectSystem::shakeCamera, | 64 | "shakeCamera", &EffectSystem::shakeCamera, |
| 64 | "stopShakingCamera", &EffectSystem::stopShakingCamera); | 65 | "stopShakingCamera", &EffectSystem::stopShakingCamera); |
| 65 | 66 | ||
| 67 | engine_.new_usertype<CameraSystem>( | ||
| 68 | "camera", | ||
| 69 | "panToSprite", &CameraSystem::panToSprite, | ||
| 70 | "isPanning", &CameraSystem::isPanning, | ||
| 71 | "unlockCamera", &CameraSystem::unlockCamera, | ||
| 72 | "setFollowingSprite", &CameraSystem::setFollowingSprite); | ||
| 73 | |||
| 66 | engine_.new_usertype<Mixer>( | 74 | engine_.new_usertype<Mixer>( |
| 67 | "mixer", | 75 | "mixer", |
| 68 | "playSound", &Mixer::playSound, | 76 | "playSound", &Mixer::playSound, |
| @@ -100,6 +108,12 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { | |||
| 100 | }); | 108 | }); |
| 101 | 109 | ||
| 102 | engine_.set_function( | 110 | engine_.set_function( |
| 111 | "camera", | ||
| 112 | [&] () -> CameraSystem& { | ||
| 113 | return game_.getSystem<CameraSystem>(); | ||
| 114 | }); | ||
| 115 | |||
| 116 | engine_.set_function( | ||
| 103 | "mixer", | 117 | "mixer", |
| 104 | [&] () -> Mixer& { | 118 | [&] () -> Mixer& { |
| 105 | return game_.getMixer(); | 119 | return game_.getMixer(); |
