Skip to content

Xrysnow/cocos2d-x-live2d

Repository files navigation

cocos2d-x-live2d

This project provides Live2D support for cocos2d-x v4 and this project.

You need to download Cubism SDK for Native from here and copy files in Core folder in the SDK to Core folder in this project. For license of usage, please check here.

This project is base on Cubism Native Samples and published under Live2D Open Software License.

Note

Branch v3 can work with cocos2d-x v3, but will not be maintained any more.

Example in Lua

local model = l2d.Model:create('Haru', 'Haru.model3.json')
scene:addChild(model)
model:setPosition(cc.p(500, 500))
model:setTouchEnabled(true)
model:setAutoDragging(true)
model:addClickEventListener(function()
    local pos = model:getTouchEndPosition()
    if model:areaHitTest('Head', pos.x, pos.y) then
        print('hit at head')
    end
end)

Remember to call l2d::Framework::end() in C++ to end the framework.

About

Live2D for cocos2d-x, with lua binding

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published