示例#1
0
    def runAnimation_forInput_withSuperlayer_(self, pluginName,input_or_dict,superlayer):
        input_arg = input_or_dict
        duration = None


        if isinstance(input_or_dict, NSDictionary) or isinstance(input_or_dict, NSMutableDictionary):
            input_arg = {}
            for k in input_or_dict:
                if input_or_dict[k]:
                    arg = input_or_dict[k]
                    
                    if hasattr(arg, 'layer'):

                        input_arg[k] = CSAnimationInput(arg)

                    else:
                        if k == 'duration':
                            duration = float(arg)
                        input_arg[k] = arg
                else:
                    input_arg[k] = None



        animation = plugin_source.load_plugin(pluginName)
        reload(animation)
        CSAnimationBlock.threadData.superLayer = superlayer


        CSAnimationBlock.beginAnimation(duration)
        animation.wait = CSAnimationBlock.wait
        animation.waitAnimation = CSAnimationBlock.waitAnimation
        animation.animationDuration = CSAnimationBlock.animationDuration

        try:
            animation.do_animation(input_arg, duration)
        except:
            CSAnimationBlock.commitAnimation()
            raise
        else:
            CSAnimationBlock.commitAnimation()
示例#2
0
    def runAnimation_forInput_withSuperlayer_(self, pluginName, input_or_dict,
                                              superlayer):
        input_arg = input_or_dict
        duration = None

        if isinstance(input_or_dict, NSDictionary) or isinstance(
                input_or_dict, NSMutableDictionary):
            input_arg = {}
            for k in input_or_dict:
                if input_or_dict[k]:
                    arg = input_or_dict[k]

                    if hasattr(arg, 'layer'):

                        input_arg[k] = CSAnimationInput(arg)

                    else:
                        if k == 'duration':
                            duration = float(arg)
                        input_arg[k] = arg
                else:
                    input_arg[k] = None

        animation = plugin_source.load_plugin(pluginName)
        reload(animation)
        CSAnimationBlock.threadData.superLayer = superlayer

        CSAnimationBlock.beginAnimation(duration)
        animation.wait = CSAnimationBlock.wait
        animation.waitAnimation = CSAnimationBlock.waitAnimation
        animation.animationDuration = CSAnimationBlock.animationDuration

        try:
            animation.do_animation(input_arg, duration)
        except:
            CSAnimationBlock.commitAnimation()
            raise
        else:
            CSAnimationBlock.commitAnimation()
示例#3
0
def wait(duration=0):
    CSAnimationBlock.wait(duration, None)
示例#4
0
def wait(duration=0):
    CSAnimationBlock.wait(duration, None)