Add Animation2D Lua binding.
This commit is contained in:
parent
a6f18c41ea
commit
f9ad7c439f
23
Source/Engine/LuaScript/pkgs/Urho2D/AnimatedSprite2D.pkg
Normal file
23
Source/Engine/LuaScript/pkgs/Urho2D/AnimatedSprite2D.pkg
Normal file
@ -0,0 +1,23 @@
|
||||
$#include "AnimatedSprite2D.h"
|
||||
|
||||
enum CycleMode
|
||||
{
|
||||
CM_LOOP = 0,
|
||||
CM_CLAMP,
|
||||
CM_PINGPONG,
|
||||
};
|
||||
|
||||
class AnimatedSprite2D : public StaticSprite2D
|
||||
{
|
||||
void SetSpeed(float speed);
|
||||
void SetCycleMode(CycleMode cycleMode);
|
||||
void SetAnimation(Animation2D* animation, float startTime = 0.0f);
|
||||
|
||||
float GetSpeed() const;
|
||||
CycleMode GetCycleMode() const;
|
||||
Animation2D* GetAnimation() const;
|
||||
|
||||
tolua_property__get_set float speed;
|
||||
tolua_property__get_set CycleMode cycleMode;
|
||||
tolua_property__get_set Animation2D* animation;
|
||||
};
|
16
Source/Engine/LuaScript/pkgs/Urho2D/Animation2D.pkg
Normal file
16
Source/Engine/LuaScript/pkgs/Urho2D/Animation2D.pkg
Normal file
@ -0,0 +1,16 @@
|
||||
$#include "Animation2D.h"
|
||||
|
||||
struct KeyFrame2D
|
||||
{
|
||||
};
|
||||
|
||||
class Animation2D : public Resource
|
||||
{
|
||||
float GetTotalTime() const;
|
||||
unsigned GetNumKeyFrames() const;
|
||||
const KeyFrame2D* GetKeyFrameByTime(float time) const;
|
||||
const KeyFrame2D* GetKeyFrameByIndex(unsigned index) const;
|
||||
|
||||
tolua_readonly tolua_property__get_set float totalTime;
|
||||
tolua_readonly tolua_property__get_set unsigned numKeyFrames;
|
||||
};
|
@ -1,9 +1,11 @@
|
||||
$pfile "Urho2D/Drawable2D.pkg"
|
||||
$pfile "Urho2D/ParticleModel2D.pkg"
|
||||
$pfile "Urho2D/ParticleEmitter2D.pkg"
|
||||
$pfile "Urho2D/Sprite2D.pkg"
|
||||
$pfile "Urho2D/SpriteSheet2D.pkg"
|
||||
$pfile "Urho2D/StaticSprite2D.pkg"
|
||||
$pfile "Urho2D/Animation2D.pkg"
|
||||
$pfile "Urho2D/AnimatedSprite2D.pkg"
|
||||
$pfile "Urho2D/ParticleModel2D.pkg"
|
||||
$pfile "Urho2D/ParticleEmitter2D.pkg"
|
||||
|
||||
$using namespace Urho3D;
|
||||
$#pragma warning(disable:4800)
|
||||
|
Loading…
Reference in New Issue
Block a user