cocos2d-lua 按钮果冻效果

     按钮的点击时类似果冻Q弹的效果

 

    local function generate_action(params)
        local scale_action = cc.ScaleTo:create(params.time, params.scale_x, params.scale_y, params.scale_z)
        local fade_action  = cc.FadeIn:create(params.time)
        return cc.Spawn:create(scale_action, fade_action)    
    end
    local spawn_action1 = generate_action({time = 0.06, scale_x = 0.63, scale_y = 1.3, scale_z = 1})
    local spawn_action2 = generate_action({time = 0.12, scale_x = 1.1, scale_y = 0.7, scale_z = 1})
    local spawn_action3 = generate_action({time = 0.07, scale_x = 0.8, scale_y = 1.1, scale_z = 1})
    local spawn_action4 = generate_action({time = 0.07, scale_x = 1.1, scale_y = 0.95, scale_z = 1})
    local spawn_action5 = generate_action({time = 0.07, scale_x = 1, scale_y = 1, scale_z = 1})
    local seq_actions = cc.Sequence:create(cc.DelayTime:create(delay_show)
                                           ,spawn_action1, spawn_action2, spawn_action3
                                           ,spawn_action4, spawn_action5
                                           ,cc.CallFunc:create(function() self:handler_action_finished_logic(index) end))

 

 

 

 

 

你可能感兴趣的:(cocos2d-lua)