Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TransformAnimationComponent to LuaInterpreter #570

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions rootex/script/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include "core/resource_files/text_resource_file.h"
#include "core/resource_files/particle_effect_resource_file.h"
#include "event_manager.h"
#include "components/space/transform_animation_component.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this line above, where all other component header files are being included. (Line 29)


extern "C" int luaopen_lpeg(lua_State* L);

Expand Down Expand Up @@ -449,6 +450,7 @@ void LuaInterpreter::registerTypes()
{
sol::usertype<Entity> entity = rootex.new_usertype<Entity>("Entity",
"transform", sol::property(&Entity::getComponent<TransformComponent>),
"transformAnimationComponent", sol::property(&Entity::getComponent<TransformAnimationComponent>),
"model", sol::property(&Entity::getComponent<ModelComponent>),
"animatedModel", sol::property(&Entity::getComponent<AnimatedModelComponent>),
"particleEffect", sol::property(&Entity::getComponent<ParticleEffectComponent>),
Expand Down Expand Up @@ -522,6 +524,15 @@ void LuaInterpreter::registerTypes()
sol::base_classes, sol::bases<Component, RenderableComponent>());
modelComponent["getModelResourceFile"] = &ModelComponent::getModelResourceFile;
}
{
sol::usertype<TransformAnimationComponent> transformAnimationComponent = rootex.new_usertype<TransformAnimationComponent>(
"TransformAnimationComponent",
sol::base_classes, sol::bases<Component>());
transformAnimationComponent["play"] = &TransformAnimationComponent::setPlaying;
transformAnimationComponent["reset"] = &TransformAnimationComponent::reset;
transformAnimationComponent["isPlaying"] = &TransformAnimationComponent::isPlaying;
transformAnimationComponent["hasEnded"] = &TransformAnimationComponent::hasEnded;
}
{
sol::usertype<AnimatedModelComponent> animatedModelComponent = rootex.new_usertype<AnimatedModelComponent>(
"AnimatedModelComponent",
Expand Down