예제 #1
0
 static int CacheFrames(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DragonBones.AnimationData obj = (DragonBones.AnimationData)ToLua.CheckObject(L, 1, typeof(DragonBones.AnimationData));
         float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         obj.CacheFrames(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #2
0
 static int AddSlotTimeline(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DragonBones.AnimationData    obj  = (DragonBones.AnimationData)ToLua.CheckObject(L, 1, typeof(DragonBones.AnimationData));
         DragonBones.SlotTimelineData arg0 = (DragonBones.SlotTimelineData)ToLua.CheckObject(L, 2, typeof(DragonBones.SlotTimelineData));
         obj.AddSlotTimeline(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int GetConstraintTimelines(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DragonBones.AnimationData obj = (DragonBones.AnimationData)ToLua.CheckObject <DragonBones.AnimationData>(L, 1);
         string arg0 = ToLua.CheckString(L, 2);
         System.Collections.Generic.List <DragonBones.TimelineData> o = obj.GetConstraintTimelines(arg0);
         ToLua.PushSealed(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #4
0
 static int GetSlotCachedFrameIndices(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DragonBones.AnimationData obj = (DragonBones.AnimationData)ToLua.CheckObject(L, 1, typeof(DragonBones.AnimationData));
         string arg0 = ToLua.CheckString(L, 2);
         System.Collections.Generic.List <int> o = obj.GetSlotCachedFrameIndices(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int AddBoneTimeline(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         DragonBones.AnimationData obj  = (DragonBones.AnimationData)ToLua.CheckObject <DragonBones.AnimationData>(L, 1);
         DragonBones.BoneData      arg0 = (DragonBones.BoneData)ToLua.CheckObject <DragonBones.BoneData>(L, 2);
         DragonBones.TimelineData  arg1 = (DragonBones.TimelineData)ToLua.CheckObject <DragonBones.TimelineData>(L, 3);
         obj.AddBoneTimeline(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #6
0
 static int GetSlotTimeline(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DragonBones.AnimationData obj = (DragonBones.AnimationData)ToLua.CheckObject(L, 1, typeof(DragonBones.AnimationData));
         string arg0 = ToLua.CheckString(L, 2);
         DragonBones.SlotTimelineData o = obj.GetSlotTimeline(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int set_parent(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj  = (DragonBones.AnimationData)o;
            DragonBones.ArmatureData  arg0 = (DragonBones.ArmatureData)ToLua.CheckObject <DragonBones.ArmatureData>(L, 2);
            obj.parent = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index parent on a nil value"));
        }
    }
    static int set_fadeInTime(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj = (DragonBones.AnimationData)o;
            float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.fadeInTime = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index fadeInTime on a nil value"));
        }
    }
    static int get_parent(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj = (DragonBones.AnimationData)o;
            DragonBones.ArmatureData  ret = obj.parent;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index parent on a nil value"));
        }
    }
예제 #10
0
    static int get_animationData(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationState obj = (DragonBones.AnimationState)o;
            DragonBones.AnimationData  ret = obj.animationData;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index animationData on a nil value" : e.Message));
        }
    }
예제 #11
0
    static int get_cacheFrameRate(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj = (DragonBones.AnimationData)o;
            float ret = obj.cacheFrameRate;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index cacheFrameRate on a nil value" : e.Message));
        }
    }
예제 #12
0
 static int _init(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         DragonBones.TimelineState <DragonBones.AnimationFrameData, DragonBones.AnimationData> obj = (DragonBones.TimelineState <DragonBones.AnimationFrameData, DragonBones.AnimationData>)ToLua.CheckObject(L, 1, typeof(DragonBones.TimelineState <DragonBones.AnimationFrameData, DragonBones.AnimationData>));
         DragonBones.Armature       arg0 = (DragonBones.Armature)ToLua.CheckObject(L, 2, typeof(DragonBones.Armature));
         DragonBones.AnimationState arg1 = (DragonBones.AnimationState)ToLua.CheckObject(L, 3, typeof(DragonBones.AnimationState));
         DragonBones.AnimationData  arg2 = (DragonBones.AnimationData)ToLua.CheckObject(L, 4, typeof(DragonBones.AnimationData));
         obj._init(arg0, arg1, arg2);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int get_cachedFrames(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj = (DragonBones.AnimationData)o;
            System.Collections.Generic.List <bool> ret = obj.cachedFrames;
            ToLua.PushSealed(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index cachedFrames on a nil value"));
        }
    }
예제 #14
0
    static int set_zOrderTimeline(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData      obj  = (DragonBones.AnimationData)o;
            DragonBones.ZOrderTimelineData arg0 = (DragonBones.ZOrderTimelineData)ToLua.CheckObject(L, 2, typeof(DragonBones.ZOrderTimelineData));
            obj.zOrderTimeline = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index zOrderTimeline on a nil value" : e.Message));
        }
    }
    static int get_fadeInTime(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj = (DragonBones.AnimationData)o;
            float ret = obj.fadeInTime;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index fadeInTime on a nil value"));
        }
    }
예제 #16
0
    static int set_cacheFrameRate(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj = (DragonBones.AnimationData)o;
            float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.cacheFrameRate = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index cacheFrameRate on a nil value" : e.Message));
        }
    }
예제 #17
0
    static int set_name(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj = (DragonBones.AnimationData)o;
            string arg0 = ToLua.CheckString(L, 2);
            obj.name = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index name on a nil value" : e.Message));
        }
    }
예제 #18
0
    static int get_zOrderTimeline(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData      obj = (DragonBones.AnimationData)o;
            DragonBones.ZOrderTimelineData ret = obj.zOrderTimeline;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index zOrderTimeline on a nil value" : e.Message));
        }
    }
예제 #19
0
    static int set_playTimes(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj = (DragonBones.AnimationData)o;
            uint arg0 = (uint)LuaDLL.luaL_checknumber(L, 2);
            obj.playTimes = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index playTimes on a nil value" : e.Message));
        }
    }
예제 #20
0
    static int get_ffdTimelines(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj = (DragonBones.AnimationData)o;
            System.Collections.Generic.Dictionary <string, System.Collections.Generic.Dictionary <string, System.Collections.Generic.Dictionary <string, DragonBones.FFDTimelineData> > > ret = obj.ffdTimelines;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index ffdTimelines on a nil value" : e.Message));
        }
    }
예제 #21
0
    static int get_slotCachedFrameIndices(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj = (DragonBones.AnimationData)o;
            System.Collections.Generic.Dictionary <string, System.Collections.Generic.List <int> > ret = obj.slotCachedFrameIndices;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index slotCachedFrameIndices on a nil value" : e.Message));
        }
    }
예제 #22
0
    static int get_name(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj = (DragonBones.AnimationData)o;
            string ret = obj.name;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index name on a nil value" : e.Message));
        }
    }
    static int get_constraintTimelines(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj = (DragonBones.AnimationData)o;
            System.Collections.Generic.Dictionary <string, System.Collections.Generic.List <DragonBones.TimelineData> > ret = obj.constraintTimelines;
            ToLua.PushSealed(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index constraintTimelines on a nil value"));
        }
    }
예제 #24
0
    static int get_playTimes(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.AnimationData obj = (DragonBones.AnimationData)o;
            uint ret = obj.playTimes;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index playTimes on a nil value" : e.Message));
        }
    }
예제 #25
0
 static int GetFFDTimeline(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         DragonBones.AnimationData obj = (DragonBones.AnimationData)ToLua.CheckObject(L, 1, typeof(DragonBones.AnimationData));
         string arg0 = ToLua.CheckString(L, 2);
         string arg1 = ToLua.CheckString(L, 3);
         System.Collections.Generic.Dictionary <string, DragonBones.FFDTimelineData> o = obj.GetFFDTimeline(arg0, arg1);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #26
0
    static int _CreateDragonBones_AnimationData(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                DragonBones.AnimationData obj = new DragonBones.AnimationData();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: DragonBones.AnimationData.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
예제 #27
0
        /**
         * @private
         */
        internal void _init(Armature armature, AnimationData animationData, AnimationConfig animationConfig)
        {
            _armature      = armature;
            _animationData = animationData;
            _name          = !string.IsNullOrEmpty(animationConfig.name) ? animationConfig.name : animationConfig.animationName;

            actionEnabled    = animationConfig.actionEnabled;
            additiveBlending = animationConfig.additiveBlending;
            displayControl   = animationConfig.displayControl;
            playTimes        = (uint)animationConfig.playTimes;
            timeScale        = animationConfig.timeScale;
            fadeTotalTime    = animationConfig.fadeInTime;
            autoFadeOutTime  = animationConfig.autoFadeOutTime;
            weight           = animationConfig.weight;

            if (animationConfig.pauseFadeIn)
            {
                _playheadState = 2; // 10
            }
            else
            {
                _playheadState = 3; // 11
            }

            _fadeState    = -1;
            _subFadeState = -1;
            _layer        = animationConfig.layer;
            _time         = animationConfig.position;
            _group        = animationConfig.group;

            if (animationConfig.duration < 0.0f)
            {
                _position = 0.0f;
                _duration = _animationData.duration;
                if (animationConfig.position != 0.0f)
                {
                    if (timeScale >= 0.0f)
                    {
                        _time = animationConfig.position;
                    }
                    else
                    {
                        _time = animationConfig.position - _duration;
                    }
                }
                else
                {
                    _time = 0.0f;
                }
            }
            else
            {
                _position = animationConfig.position;
                _duration = animationConfig.duration;
                _time     = 0.0f;
            }

            if (timeScale < 0.0f && _time == 0.0f)
            {
                _time = -0.000001f; // Can not cross last frame event.
            }

            if (fadeTotalTime <= 0.0f)
            {
                _fadeProgress = 0.999999f;
            }

            if (animationConfig.boneMask.Count > 0)
            {
                DragonBones.ResizeList(_boneMask, animationConfig.boneMask.Count, null);
                for (int i = 0, l = _boneMask.Count; i < l; ++i)
                {
                    _boneMask[i] = animationConfig.boneMask[i];
                }
            }

            _timeline = BaseObject.BorrowObject <AnimationTimelineState>();
            _timeline._init(_armature, this, _animationData);

            if (_animationData.zOrderTimeline != null)
            {
                _zOrderTimeline = BaseObject.BorrowObject <ZOrderTimelineState>();
                _zOrderTimeline._init(_armature, this, _animationData.zOrderTimeline);
            }

            _updateTimelineStates();
        }
예제 #28
0
        /// <inheritDoc/>
        protected override void _OnClear()
        {
            foreach (var action in this.defaultActions)
            {
                action.ReturnToPool();
            }

            foreach (var action in this.actions)
            {
                action.ReturnToPool();
            }

            foreach (var k in this.bones.Keys)
            {
                this.bones[k].ReturnToPool();
            }

            foreach (var k in this.slots.Keys)
            {
                this.slots[k].ReturnToPool();
            }

            foreach (var k in this.constraints.Keys)
            {
                this.constraints[k].ReturnToPool();
            }

            foreach (var k in this.skins.Keys)
            {
                this.skins[k].ReturnToPool();
            }

            foreach (var k in this.animations.Keys)
            {
                this.animations[k].ReturnToPool();
            }

            if (this.canvas != null)
            {
                this.canvas.ReturnToPool();
            }

            if (this.userData != null)
            {
                this.userData.ReturnToPool();
            }

            this.type           = ArmatureType.Armature;
            this.frameRate      = 0;
            this.cacheFrameRate = 0;
            this.scale          = 1.0f;
            this.name           = "";
            this.aabb.Clear();
            this.animationNames.Clear();
            this.sortedBones.Clear();
            this.sortedSlots.Clear();
            this.defaultActions.Clear();
            this.actions.Clear();
            this.bones.Clear();
            this.slots.Clear();
            this.constraints.Clear();
            this.skins.Clear();
            this.animations.Clear();
            this.defaultSkin      = null;
            this.defaultAnimation = null;
            this.canvas           = null;
            this.userData         = null;
            this.parent           = null; //
        }