diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/script_system.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
| diff --git a/src/script_system.cpp b/src/script_system.cpp index 3ac04ac..8674f97 100644 --- a/src/script_system.cpp +++ b/src/script_system.cpp | |||
| @@ -20,6 +20,11 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { | |||
| 20 | "x", [] (const vec2i& v) { return v.x(); }, | 20 | "x", [] (const vec2i& v) { return v.x(); }, |
| 21 | "y", [] (const vec2i& v) { return v.y(); }); | 21 | "y", [] (const vec2i& v) { return v.y(); }); |
| 22 | 22 | ||
| 23 | engine_.new_usertype<SpriteFrame>( | ||
| 24 | "spriteframe", | ||
| 25 | "center", &SpriteFrame::center, | ||
| 26 | "size", &SpriteFrame::size); | ||
| 27 | |||
| 23 | engine_.new_usertype<Sprite>( | 28 | engine_.new_usertype<Sprite>( |
| 24 | "sprite", | 29 | "sprite", |
| 25 | "loc", &Sprite::loc, | 30 | "loc", &Sprite::loc, |
| @@ -27,7 +32,10 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { | |||
| 27 | "followers", &Sprite::followers, | 32 | "followers", &Sprite::followers, |
| 28 | "characterState", &Sprite::characterState, | 33 | "characterState", &Sprite::characterState, |
| 29 | "controllable", &Sprite::controllable, | 34 | "controllable", &Sprite::controllable, |
| 30 | "animFinished", &Sprite::animFinished); | 35 | "animFinished", &Sprite::animFinished, |
| 36 | "getCurrentFrame", [] (const Sprite& sprite) -> const SpriteFrame& { | ||
| 37 | return sprite.frames[sprite.animations[sprite.animationId].frameIndices[sprite.animationFrame]]; | ||
| 38 | }); | ||
| 31 | 39 | ||
| 32 | engine_.new_usertype<MessageSystem>( | 40 | engine_.new_usertype<MessageSystem>( |
| 33 | "message", | 41 | "message", |
