├── .gitignore ├── Makefile ├── README.md └── creator_project ├── assets ├── A Damn Mess.ttf ├── A Damn Mess.ttf.meta ├── American Typewriter.ttf ├── American Typewriter.ttf.meta ├── Animation1.anim ├── Animation1.anim.meta ├── Animation2.anim ├── Animation2.anim.meta ├── Galaxy.plist ├── Galaxy.plist.meta ├── arial16.fnt ├── arial16.fnt.meta ├── arial16.png ├── arial16.png.meta ├── ghosts.plist ├── ghosts.plist.meta ├── ghosts.png ├── ghosts.png.meta ├── goblins.atlas ├── goblins.atlas.meta ├── goblins.json ├── goblins.json.meta ├── goblins.png ├── goblins.png.meta ├── goblins.skel ├── goblins.skel.meta ├── grossini.png ├── grossini.png.meta ├── grossini_dance_08.png ├── grossini_dance_08.png.meta ├── grossinis_sister1.png ├── grossinis_sister1.png.meta ├── grossinis_sister2.png ├── grossinis_sister2.png.meta ├── iso-test.png ├── iso-test.png.meta ├── iso-test.tmx ├── iso-test.tmx.meta ├── scenes.meta ├── scenes │ ├── Label.meta │ ├── Label │ │ ├── CreatorLabels.fire │ │ └── CreatorLabels.fire.meta │ ├── Main.fire │ ├── Main.fire.meta │ ├── Mask.meta │ ├── Mask │ │ ├── Mask.fire │ │ └── Mask.fire.meta │ ├── animation.meta │ ├── animation │ │ ├── CreatorAnim.fire │ │ └── CreatorAnim.fire.meta │ ├── collider.meta │ ├── collider │ │ ├── collider.fire │ │ └── collider.fire.meta │ ├── dragon_bones.meta │ ├── dragon_bones │ │ ├── CoreElement.json │ │ ├── CoreElement.json.meta │ │ ├── CoreElement_texture_1.json │ │ ├── CoreElement_texture_1.json.meta │ │ ├── CoreElement_texture_1.png │ │ ├── CoreElement_texture_1.png.meta │ │ ├── DragonBones.fire │ │ ├── DragonBones.fire.meta │ │ ├── DragonMesh.fire │ │ ├── DragonMesh.fire.meta │ │ ├── NewDragonTest.json │ │ ├── NewDragonTest.json.meta │ │ ├── texture.json │ │ ├── texture.json.meta │ │ ├── texture.png │ │ └── texture.png.meta │ ├── motionstreak.meta │ ├── motionstreak │ │ ├── anim1.anim │ │ ├── anim1.anim.meta │ │ ├── motionstreak.fire │ │ ├── motionstreak.fire.meta │ │ ├── streak.png │ │ └── streak.png.meta │ ├── pageview.meta │ ├── pageview │ │ ├── pageview.fire │ │ └── pageview.fire.meta │ ├── prefab.meta │ ├── prefab │ │ ├── prefab-test.fire │ │ ├── prefab-test.fire.meta │ │ ├── sprite-prefab.prefab │ │ └── sprite-prefab.prefab.meta │ ├── richtext.meta │ ├── richtext │ │ ├── CreatorRichtext.fire │ │ └── CreatorRichtext.fire.meta │ ├── slider.meta │ ├── slider │ │ ├── slider.fire │ │ └── slider.fire.meta │ ├── sprites.meta │ ├── sprites │ │ ├── CreatorSprites.fire │ │ └── CreatorSprites.fire.meta │ ├── tilemap.meta │ ├── tilemap │ │ ├── CreatorTilemap.fire │ │ └── CreatorTilemap.fire.meta │ ├── toggle.meta │ ├── toggle │ │ ├── toggle.fire │ │ └── toggle.fire.meta │ ├── toggle_group.meta │ ├── toggle_group │ │ ├── toggle_group.fire │ │ └── toggle_group.fire.meta │ ├── ui.meta │ ├── ui │ │ ├── CreatorUI.fire │ │ └── CreatorUI.fire.meta │ ├── video.meta │ ├── video │ │ ├── VideoPlayer.fire │ │ ├── VideoPlayer.fire.meta │ │ ├── cocosvideo.mp4 │ │ └── cocosvideo.mp4.meta │ ├── webview.meta │ └── webview │ │ ├── WebView.fire │ │ └── WebView.fire.meta ├── test_polygon.plist ├── test_polygon.plist.meta ├── test_polygon.png ├── test_polygon.png.meta ├── ui.plist ├── ui.plist.meta ├── ui.png └── ui.png.meta ├── creator.d.ts ├── jsconfig.json ├── packages └── creator-luacpp-support │ ├── CreatorReader.fbs │ ├── bin │ ├── flatc │ └── flatc.exe │ ├── core │ ├── BuildWorker.js │ ├── Constants.js │ ├── Project.js │ ├── Utils.js │ ├── WorkerBase.js │ └── parser │ │ ├── Button.js │ │ ├── Canvas.js │ │ ├── Collider.js │ │ ├── ConvertFireToJson.js │ │ ├── DragonBones.js │ │ ├── EditBox.js │ │ ├── Global.js │ │ ├── Label.js │ │ ├── Mask.js │ │ ├── MotionStreak.js │ │ ├── Node.js │ │ ├── PageView.js │ │ ├── ParticleSystem.js │ │ ├── Prefab.js │ │ ├── ProgressBar.js │ │ ├── RichText.js │ │ ├── Scene.js │ │ ├── ScrollView.js │ │ ├── Slider.js │ │ ├── SpineSkeleton.js │ │ ├── Sprite.js │ │ ├── TiledMap.js │ │ ├── Toggle.js │ │ ├── ToggleGroup.js │ │ ├── Utils.js │ │ ├── VideoPlayer.js │ │ └── WebView.js │ ├── main.js │ ├── package.json │ ├── panels │ ├── setup-project-panel.html │ ├── setup-project-panel.js │ └── style.css │ └── reader │ ├── Android.mk │ ├── CMakeLists.txt │ ├── CreatorReader.cpp │ ├── CreatorReader.h │ ├── CreatorReader_generated.h │ ├── Macros.h │ ├── animation │ ├── AnimateClip.cpp │ ├── AnimateClip.h │ ├── AnimationClip.cpp │ ├── AnimationClip.h │ ├── AnimationClipProperties.h │ ├── AnimationManager.cpp │ ├── AnimationManager.h │ ├── Bezier.cpp │ ├── Bezier.h │ ├── Easing.cpp │ └── Easing.h │ ├── collider │ ├── Collider.cpp │ ├── Collider.h │ ├── ColliderManager.cpp │ ├── ColliderManager.h │ ├── Contract.cpp │ ├── Contract.h │ ├── Intersection.cpp │ └── Intersection.h │ ├── dragonbones │ ├── Android.mk │ ├── CMakeLists.txt │ ├── DragonBonesHeaders.h │ ├── animation │ │ ├── Animation.cpp │ │ ├── Animation.h │ │ ├── AnimationState.cpp │ │ ├── AnimationState.h │ │ ├── BaseTimelineState.h │ │ ├── IAnimateble.h │ │ ├── TimelineState.cpp │ │ ├── TimelineState.h │ │ ├── WorldClock.cpp │ │ └── WorldClock.h │ ├── armature │ │ ├── Armature.cpp │ │ ├── Armature.h │ │ ├── Bone.cpp │ │ ├── Bone.h │ │ ├── IArmatureDisplay.h │ │ ├── Slot.cpp │ │ ├── Slot.h │ │ └── TransformObject.h │ ├── cocos2dx │ │ ├── CCArmatureDisplay.cpp │ │ ├── CCArmatureDisplay.h │ │ ├── CCDragonBonesHeaders.h │ │ ├── CCFactory.cpp │ │ ├── CCFactory.h │ │ ├── CCSlot.cpp │ │ ├── CCSlot.h │ │ ├── CCTextureData.cpp │ │ └── CCTextureData.h │ ├── core │ │ ├── BaseObject.cpp │ │ ├── BaseObject.h │ │ └── DragonBones.h │ ├── events │ │ ├── EventObject.cpp │ │ └── EventObject.h │ ├── factories │ │ ├── BaseFactory.cpp │ │ └── BaseFactory.h │ ├── geom │ │ ├── ColorTransform.h │ │ ├── Matrix.h │ │ ├── Point.h │ │ ├── Rectangle.h │ │ └── Transform.h │ ├── model │ │ ├── AnimationData.cpp │ │ ├── AnimationData.h │ │ ├── ArmatureData.cpp │ │ ├── ArmatureData.h │ │ ├── DragonBonesData.cpp │ │ ├── DragonBonesData.h │ │ ├── FrameData.cpp │ │ ├── FrameData.h │ │ ├── TimelineData.cpp │ │ └── TimelineData.h │ ├── parsers │ │ ├── DataParser.cpp │ │ ├── DataParser.h │ │ ├── JSONDataParser.cpp │ │ └── JSONDataParser.h │ └── textures │ │ ├── TextureData.cpp │ │ └── TextureData.h │ ├── flatbuffers │ ├── code_generators.h │ ├── flatbuffers.h │ ├── grpc.h │ ├── hash.h │ ├── idl.h │ ├── reflection.h │ ├── reflection_generated.h │ └── util.h │ ├── lua-bindings │ ├── creator_reader_bindings.cpp │ ├── creator_reader_bindings.hpp │ ├── dragonbones │ │ ├── lua_dragonbones_auto.cpp │ │ ├── lua_dragonbones_auto.hpp │ │ ├── lua_dragonbones_manual.cpp │ │ └── lua_dragonbones_manual.hpp │ └── reader │ │ ├── lua_creator_reader_auto.cpp │ │ ├── lua_creator_reader_auto.hpp │ │ ├── lua_creator_reader_manual.cpp │ │ └── lua_creator_reader_manual.hpp │ └── ui │ ├── PageView.cpp │ ├── PageView.h │ ├── RichtextStringVisitor.cpp │ └── RichtextStringVisitor.h ├── project.json └── settings ├── creator-luacpp-support.json └── project.json /.gitignore: -------------------------------------------------------------------------------- 1 | #///////////////////////////////////////////////////////////////////////////// 2 | # Fireball Projects 3 | #///////////////////////////////////////////////////////////////////////////// 4 | 5 | creator_project/library/ 6 | creator_project/temp/ 7 | creator_project/local/ 8 | creator_project/build/ 9 | creator_project/temp/ 10 | creator_project/json/ 11 | creator_project/ccreator/ 12 | creator_project/settings/ 13 | #///////////////////////////////////////////////////////////////////////////// 14 | # Logs and databases 15 | #///////////////////////////////////////////////////////////////////////////// 16 | 17 | *.log 18 | *.sql 19 | *.sqlite 20 | 21 | #///////////////////////////////////////////////////////////////////////////// 22 | # files for debugger 23 | #///////////////////////////////////////////////////////////////////////////// 24 | 25 | *.sln 26 | *.csproj 27 | *.pidb 28 | *.unityproj 29 | *.suo 30 | 31 | #///////////////////////////////////////////////////////////////////////////// 32 | # OS generated files 33 | #///////////////////////////////////////////////////////////////////////////// 34 | 35 | .DS_Store 36 | ehthumbs.db 37 | Thumbs.db 38 | 39 | #///////////////////////////////////////////////////////////////////////////// 40 | # exvim files 41 | #///////////////////////////////////////////////////////////////////////////// 42 | 43 | *UnityVS.meta 44 | *.err 45 | *.err.meta 46 | *.exvim 47 | *.exvim.meta 48 | *.vimentry 49 | *.vimentry.meta 50 | *.vimproject 51 | *.vimproject.meta 52 | .vimfiles.*/ 53 | .exvim.*/ 54 | quick_gen_project_*_autogen.bat 55 | quick_gen_project_*_autogen.bat.meta 56 | quick_gen_project_*_autogen.sh 57 | quick_gen_project_*_autogen.sh.meta 58 | .exvim.app 59 | *.swp 60 | 61 | #///////////////////////////////////////////////////////////////////////////// 62 | # webstorm files 63 | #///////////////////////////////////////////////////////////////////////////// 64 | 65 | .idea/ 66 | 67 | #///////////////////////////////////////////////////////////////////////////// 68 | # vscode files 69 | #///////////////////////////////////////////////////////////////////////////// 70 | 71 | .vscode/ 72 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | -./creator_project/packages/creator-luacpp-support/convert_fire_to_json.py --cocospath creator/assets --creatorassets creator_project/temp creator_project/assets/*.fire 3 | -./creator_project/packages/creator-luacpp-support/bin/flatc -c -b ./creator_project/packages/creator-luacpp-support/CreatorReader.fbs json/*.json 4 | mv *.h ~/progs/cocos2d-x/tests/cpp-tests/Classes/CreatorReaderTest/ 5 | mv *.ccreator ~/progs/cocos2d-x/tests/cpp-tests/Resources/creator/ 6 | -------------------------------------------------------------------------------- /creator_project/assets/A Damn Mess.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/A Damn Mess.ttf -------------------------------------------------------------------------------- /creator_project/assets/A Damn Mess.ttf.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "58b104e0-68e1-4f7a-ab38-4f44521a7943", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /creator_project/assets/American Typewriter.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/American Typewriter.ttf -------------------------------------------------------------------------------- /creator_project/assets/American Typewriter.ttf.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "27d18d5e-feac-410d-a9f8-8a9ddb7213c2", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /creator_project/assets/Animation1.anim.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "959ef130-f65b-4b6e-a9eb-8f0752c0e6a9", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /creator_project/assets/Animation2.anim: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.AnimationClip", 3 | "_name": "Animation2", 4 | "_objFlags": 0, 5 | "_rawFiles": null, 6 | "_duration": 8.366666666666667, 7 | "sample": 60, 8 | "speed": 1, 9 | "wrapMode": 1, 10 | "curveData": { 11 | "props": { 12 | "position": [ 13 | { 14 | "frame": 0, 15 | "value": [ 16 | 194, 17 | 536 18 | ], 19 | "motionPath": [] 20 | }, 21 | { 22 | "frame": 1.8, 23 | "value": [ 24 | 724, 25 | 502 26 | ], 27 | "motionPath": [] 28 | }, 29 | { 30 | "frame": 2.9833333333333334, 31 | "value": [ 32 | 807, 33 | 237 34 | ] 35 | }, 36 | { 37 | "frame": 4.516666666666667, 38 | "value": [ 39 | 434, 40 | 110 41 | ] 42 | }, 43 | { 44 | "frame": 6.416666666666667, 45 | "value": [ 46 | 126, 47 | 338 48 | ] 49 | }, 50 | { 51 | "frame": 8.366666666666667, 52 | "value": [ 53 | 176, 54 | 513 55 | ] 56 | } 57 | ], 58 | "rotation": [ 59 | { 60 | "frame": 1.8166666666666667, 61 | "value": 90 62 | }, 63 | { 64 | "frame": 2.9833333333333334, 65 | "value": 180 66 | }, 67 | { 68 | "frame": 4.5, 69 | "value": 270 70 | }, 71 | { 72 | "frame": 5.433333333333334, 73 | "value": 310 74 | }, 75 | { 76 | "frame": 8.016666666666667, 77 | "value": 0 78 | }, 79 | { 80 | "frame": 8.016666666666667, 81 | "value": 310 82 | }, 83 | { 84 | "frame": 8.233333333333333, 85 | "value": 310 86 | } 87 | ], 88 | "color": [ 89 | { 90 | "frame": 2.9833333333333334, 91 | "value": { 92 | "__type__": "cc.Color", 93 | "r": 255, 94 | "g": 0, 95 | "b": 0, 96 | "a": 255 97 | } 98 | }, 99 | { 100 | "frame": 4.55, 101 | "value": { 102 | "__type__": "cc.Color", 103 | "r": 71, 104 | "g": 0, 105 | "b": 255, 106 | "a": 255 107 | } 108 | }, 109 | { 110 | "frame": 7.45, 111 | "value": { 112 | "__type__": "cc.Color", 113 | "r": 0, 114 | "g": 255, 115 | "b": 41, 116 | "a": 255 117 | } 118 | } 119 | ], 120 | "opacity": [ 121 | { 122 | "frame": 1.4, 123 | "value": 0 124 | }, 125 | { 126 | "frame": 2.3, 127 | "value": 255 128 | } 129 | ] 130 | } 131 | }, 132 | "events": [] 133 | } -------------------------------------------------------------------------------- /creator_project/assets/Animation2.anim.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "a9f7ecca-8529-47dc-9f2d-8bc3e27edfcd", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /creator_project/assets/Galaxy.plist.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "d33c6bfb-d1f8-4934-9b02-d0479f63ffd0", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /creator_project/assets/arial16.fnt.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.1.0", 3 | "uuid": "bffc9dd6-8114-4c3d-a0a6-03a4927e026c", 4 | "textureUuid": "2c8df125-099b-4cc6-aa64-a27080e09ead", 5 | "fontSize": 16, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/arial16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/arial16.png -------------------------------------------------------------------------------- /creator_project/assets/arial16.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "2c8df125-099b-4cc6-aa64-a27080e09ead", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "arial16": { 9 | "ver": "1.0.3", 10 | "uuid": "9d118d40-151d-4255-bfa5-ccc223cb4026", 11 | "rawTextureUuid": "2c8df125-099b-4cc6-aa64-a27080e09ead", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": -1, 16 | "offsetY": 225.5, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 510, 20 | "height": 61, 21 | "rawWidth": 512, 22 | "rawHeight": 512, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /creator_project/assets/ghosts.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | texture 6 | 7 | width 8 | 256 9 | height 10 | 256 11 | 12 | frames 13 | 14 | child1.gif 15 | 16 | x 17 | 1 18 | y 19 | 0 20 | width 21 | 54 22 | height 23 | 130 24 | offsetX 25 | 7.5 26 | offsetY 27 | -0.5 28 | originalWidth 29 | 91 30 | originalHeight 31 | 139 32 | 33 | father.gif 34 | 35 | x 36 | 56 37 | y 38 | 1 39 | width 40 | 45 41 | height 42 | 117 43 | offsetX 44 | 5 45 | offsetY 46 | -7 47 | originalWidth 48 | 91 49 | originalHeight 50 | 139 51 | 52 | sister1.gif 53 | 54 | x 55 | 102 56 | y 57 | 1 58 | width 59 | 47 60 | height 61 | 124 62 | offsetX 63 | 5 64 | offsetY 65 | -5.5 66 | originalWidth 67 | 91 68 | originalHeight 69 | 139 70 | 71 | sister2.gif 72 | 73 | x 74 | 150 75 | y 76 | 1 77 | width 78 | 47 79 | height 80 | 109 81 | offsetX 82 | 5 83 | offsetY 84 | -12 85 | originalWidth 86 | 91 87 | originalHeight 88 | 139 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /creator_project/assets/ghosts.plist.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "ccf94b38-1f68-4088-91a4-d808a87dcb85", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /creator_project/assets/ghosts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/ghosts.png -------------------------------------------------------------------------------- /creator_project/assets/ghosts.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "bd227ca5-f287-4e15-ac27-a0c0034515b5", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "ghosts": { 9 | "ver": "1.0.3", 10 | "uuid": "6d012e8a-24dd-49f0-95b2-e20663eafcd5", 11 | "rawTextureUuid": "bd227ca5-f287-4e15-ac27-a0c0034515b5", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": -29, 16 | "offsetY": 63, 17 | "trimX": 1, 18 | "trimY": 0, 19 | "width": 196, 20 | "height": 130, 21 | "rawWidth": 256, 22 | "rawHeight": 256, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /creator_project/assets/goblins.atlas.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "52916d08-66e7-444c-be9f-8d317881ed27", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /creator_project/assets/goblins.json.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.2", 3 | "uuid": "9ebe8785-f77c-42b7-ad30-534127e6c986", 4 | "textures": [ 5 | "e00d85ba-dea3-4594-b38f-1df9e4b9dc53" 6 | ], 7 | "atlas": "52916d08-66e7-444c-be9f-8d317881ed27", 8 | "scale": 1, 9 | "subMetas": {} 10 | } -------------------------------------------------------------------------------- /creator_project/assets/goblins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/goblins.png -------------------------------------------------------------------------------- /creator_project/assets/goblins.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "e00d85ba-dea3-4594-b38f-1df9e4b9dc53", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "goblins": { 9 | "ver": "1.0.3", 10 | "uuid": "d620cb49-5aca-4591-b8bb-982d597bffb6", 11 | "rawTextureUuid": "e00d85ba-dea3-4594-b38f-1df9e4b9dc53", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": -4.5, 16 | "offsetY": 0, 17 | "trimX": 2, 18 | "trimY": 2, 19 | "width": 1011, 20 | "height": 124, 21 | "rawWidth": 1024, 22 | "rawHeight": 128, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /creator_project/assets/goblins.skel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/goblins.skel -------------------------------------------------------------------------------- /creator_project/assets/goblins.skel.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "5618b607-d70f-4ef0-af35-094737240bd7", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /creator_project/assets/grossini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/grossini.png -------------------------------------------------------------------------------- /creator_project/assets/grossini.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "a1adf703-5141-401b-808b-c13347efd216", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "grossini": { 9 | "ver": "1.0.3", 10 | "uuid": "15c079ac-5dd6-4ec5-bc0e-325ac6f4f221", 11 | "rawTextureUuid": "a1adf703-5141-401b-808b-c13347efd216", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": -24.5, 16 | "offsetY": 17.5, 17 | "trimX": 1, 18 | "trimY": 1, 19 | "width": 461, 20 | "height": 219, 21 | "rawWidth": 512, 22 | "rawHeight": 256, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /creator_project/assets/grossini_dance_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/grossini_dance_08.png -------------------------------------------------------------------------------- /creator_project/assets/grossini_dance_08.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "4e2edada-a2d6-4635-afdf-c426810de768", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "grossini_dance_08": { 9 | "ver": "1.0.3", 10 | "uuid": "fb83d83d-136a-463f-9d42-455a6b624d39", 11 | "rawTextureUuid": "4e2edada-a2d6-4635-afdf-c426810de768", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": -1, 17 | "trimX": 17, 18 | "trimY": 7, 19 | "width": 51, 20 | "height": 109, 21 | "rawWidth": 85, 22 | "rawHeight": 121, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /creator_project/assets/grossinis_sister1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/grossinis_sister1.png -------------------------------------------------------------------------------- /creator_project/assets/grossinis_sister1.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "b6d52d4a-af20-4de3-a424-545bba532ef7", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "grossinis_sister1": { 9 | "ver": "1.0.3", 10 | "uuid": "5a78327f-4897-45ef-8bc4-b32538899821", 11 | "rawTextureUuid": "b6d52d4a-af20-4de3-a424-545bba532ef7", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": -0.5, 16 | "offsetY": -11.5, 17 | "trimX": 2, 18 | "trimY": 25, 19 | "width": 47, 20 | "height": 112, 21 | "rawWidth": 52, 22 | "rawHeight": 139, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /creator_project/assets/grossinis_sister2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/grossinis_sister2.png -------------------------------------------------------------------------------- /creator_project/assets/grossinis_sister2.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "55a00ee1-d4e3-4981-aa79-fa17aa2e0940", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "grossinis_sister2": { 9 | "ver": "1.0.3", 10 | "uuid": "0f491ace-1ca9-452a-9d37-7c2c618f6dda", 11 | "rawTextureUuid": "55a00ee1-d4e3-4981-aa79-fa17aa2e0940", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": -0.5, 16 | "offsetY": -2, 17 | "trimX": 1, 18 | "trimY": 8, 19 | "width": 53, 20 | "height": 126, 21 | "rawWidth": 56, 22 | "rawHeight": 138, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /creator_project/assets/iso-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/iso-test.png -------------------------------------------------------------------------------- /creator_project/assets/iso-test.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "adeab356-7b1b-499b-9901-7be7aca5e1e8", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "iso-test": { 9 | "ver": "1.0.3", 10 | "uuid": "0d6a88f6-9023-4277-99b4-a3906c260b3d", 11 | "rawTextureUuid": "adeab356-7b1b-499b-9901-7be7aca5e1e8", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": -94.5, 16 | "offsetY": 69, 17 | "trimX": 2, 18 | "trimY": 1, 19 | "width": 319, 20 | "height": 116, 21 | "rawWidth": 512, 22 | "rawHeight": 256, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /creator_project/assets/iso-test.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | H4sIAAAAAAAAA+3DwQkAAAwDoYPsv3PH6EfBVVNVVVVVVVVVVVVVVVVVVVVfH73hYN0AQAAA 9 | 10 | 11 | 12 | 13 | H4sIAAAAAAAAA+2Y2Y7DIAxFeeD/v3nEQ6UMYvGW4Gt8pKptAgnXZrFdSpLQqKcHkCTJJ9Tyf73X7js6vc6vdJ+27+3vP0m/5m4DQfubPkLxv+UYR/ssgg0sqN2nvz5rG4Gd5t42ddIuGhRtUWww0kDVFsEGKw1UG6AzswHFv4j6OWPe2QBN/26+c9YC4vrXrOlT+agVWn8h+vsHd+yaM8Er3LHP6k/ISG2APvdX/2d90OP9le8ixjVPqPnsqj8y1Hglao7PiekjrPURXBuUwfX+vmc4a3w3D3bv8GgPie8o9lrVBz3ZQbKfc2o9q3se7CA90yk5PkItSDpGS32n5wJXh1VeyG3zJhw/ScZKPSNOYrWnrWII7fvfRlvref7mxgoe9DcoedCs3+o5s3bUe18iqWFYtPOiv2G1z3PmgId9UArXr9J90ivSWJrzHFS0+RQ6nHwhov4Gcp3Agqi6qET2LRVNLh0BSf0wEpo6QgSeZ9xt2hvRzzgKN2tPkiRJEg1/QULzBABAAAA= 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /creator_project/assets/iso-test.tmx.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.4", 3 | "uuid": "893592b4-3511-4c80-89ce-72fb58f87362", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "8a932b9f-df3c-43ce-a82f-a9355f21bff7", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/Label.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "963e1e04-22ec-4cb3-b063-881369e299a3", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/Label/CreatorLabels.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "97722363-b3aa-4f8e-9983-e8438ae3542a", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/Main.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "6d9a2703-9339-460b-a10a-cebdefb422c0", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/Mask.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "dfbeb2db-3e90-4242-a830-dfa7f84fa26c", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/Mask/Mask.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "ceb0ed06-2e9d-4800-aac5-fc537876ee7b", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/animation.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "c95cde10-f55f-4de3-a7e4-d524f7914d88", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/animation/CreatorAnim.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "64d88244-2d85-4ff2-b423-34d56261ecb5", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/collider.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "2512a21b-ec00-4e0a-a47b-426ca0d23bee", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/collider/collider.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "8bb313a4-dd3e-4fba-b55b-8e80c59d2238", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/dragon_bones.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "87c6c3ca-8135-4839-b7a1-6bd69119385f", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/dragon_bones/CoreElement_texture_1.json: -------------------------------------------------------------------------------- 1 | {"name":"CoreElement","imagePath":"CoreElement_texture_1.png","SubTexture":[{"name":"weapon_1005_folder/weapon_r_4","x":2,"y":2,"width":280,"height":76},{"name":"flame_01_f/bbb","x":284,"y":2,"width":86,"height":234},{"name":"mecha_1502b_folder/chest","x":372,"y":2,"width":89,"height":192},{"name":"weapon_1005_folder/weapon_r_1","x":463,"y":2,"width":105,"height":60},{"name":"mecha_1502b_folder/thigh_r","x":463,"y":64,"width":103,"height":61},{"name":"weapon_1005_folder/weapon_r_3","x":2,"y":80,"width":202,"height":69},{"name":"mecha_1502b_folder/foot_r","x":206,"y":80,"width":29,"height":109},{"name":"mecha_1502b_folder/textures/foot_l_0","x":237,"y":80,"width":29,"height":106},{"name":"mecha_1502b_folder/thigh_l","x":463,"y":127,"width":101,"height":57},{"name":"flame_01_f/ba_bu_flame1","x":2,"y":151,"width":180,"height":52},{"name":"weapon_1502b_folder/image/paoguan_0003","x":463,"y":186,"width":94,"height":36},{"name":"mecha_1502b_folder/pelvis","x":237,"y":188,"width":41,"height":65},{"name":"_texture/fireEffect","x":184,"y":191,"width":48,"height":38},{"name":"weapon_1005_folder/a_folder/boss_zhl.0005","x":372,"y":196,"width":81,"height":37},{"name":"weapon_1005_folder/c_folder/1","x":2,"y":205,"width":136,"height":54},{"name":"weapon_1005_folder/weapon_r_2","x":455,"y":224,"width":108,"height":64},{"name":"weapon_1502b_folder/image/paoguan_0002","x":140,"y":231,"width":94,"height":36},{"name":"weapon_1005_folder/a_folder/boss_zhl.0004","x":372,"y":235,"width":81,"height":37},{"name":"weapon_1005_folder/a_folder/boss_zhl.0003","x":280,"y":238,"width":81,"height":37},{"name":"weapon_1005_folder/c_folder/0","x":2,"y":261,"width":136,"height":52},{"name":"weapon_1005_folder/c_folder/2","x":140,"y":269,"width":136,"height":51},{"name":"weapon_1005_folder/a_folder/boss_zhl.0002","x":363,"y":274,"width":81,"height":37},{"name":"weapon_1005_folder/a_folder/boss_zhl.0001","x":278,"y":277,"width":81,"height":37},{"name":"mecha_1502b_folder/calf_l","x":446,"y":290,"width":122,"height":46},{"name":"weapon_1005_folder/weapon_r_0","x":361,"y":313,"width":75,"height":40},{"name":"weapon_1005_folder/c_folder/4","x":2,"y":315,"width":136,"height":46},{"name":"bullet_01_f/bullet_01","x":278,"y":316,"width":74,"height":20},{"name":"weapon_1005_folder/c_folder/3","x":140,"y":322,"width":136,"height":43},{"name":"mecha_1502b_folder/calf_r","x":438,"y":338,"width":126,"height":52},{"name":"mecha_1502b_folder/textures/thigh_1_r_1","x":278,"y":338,"width":55,"height":32},{"name":"weapon_1502b_folder/image/paoguan_0001","x":335,"y":355,"width":94,"height":36},{"name":"weapon_1502b_folder/back_r","x":2,"y":363,"width":121,"height":45},{"name":"weapon_1502b_folder/back_l","x":125,"y":367,"width":116,"height":44},{"name":"mecha_1502b_folder/textures/shouder_l_0","x":243,"y":372,"width":44,"height":39},{"name":"mecha_1502b_folder/textures/shouder_r_1","x":289,"y":372,"width":43,"height":39},{"name":"weapon_1005_folder/b_folder/1","x":431,"y":392,"width":109,"height":49},{"name":"mecha_1502b_folder/textures/thigh_1_l_0","x":334,"y":393,"width":50,"height":32},{"name":"weapon_1005_folder/b_folder/0","x":2,"y":410,"width":110,"height":47},{"name":"weapon_1005_folder/b_folder/2","x":114,"y":413,"width":108,"height":45},{"name":"weapon_1005_folder/b_folder/4","x":224,"y":413,"width":108,"height":42},{"name":"weapon_1005_folder/b_folder/3","x":334,"y":443,"width":108,"height":41}]} -------------------------------------------------------------------------------- /creator_project/assets/scenes/dragon_bones/CoreElement_texture_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/scenes/dragon_bones/CoreElement_texture_1.png -------------------------------------------------------------------------------- /creator_project/assets/scenes/dragon_bones/CoreElement_texture_1.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "4dbe2a44-8f23-4c80-9784-2e68cdf9cafa", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "CoreElement_texture_1": { 9 | "ver": "1.0.3", 10 | "uuid": "3a04c87a-16f6-481a-9a0a-5a5490e91ffc", 11 | "rawTextureUuid": "4dbe2a44-8f23-4c80-9784-2e68cdf9cafa", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 2, 18 | "trimY": 2, 19 | "width": 566, 20 | "height": 482, 21 | "rawWidth": 570, 22 | "rawHeight": 486, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/dragon_bones/DragonBones.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "56b562db-140f-4f7f-9ce6-64bf30dde4c0", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/dragon_bones/DragonMesh.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "0fbaafb5-3725-4bb4-ba03-5403861a1900", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/dragon_bones/texture.json: -------------------------------------------------------------------------------- 1 | {"imagePath":"texture.png","name":"NewDragonTest","SubTexture":[{"x":1,"y":342,"width":447,"name":"tail","height":191},{"x":326,"y":1,"width":270,"name":"chibangL2","height":273},{"x":1,"y":761,"width":95,"name":"chibangL1","height":62},{"x":955,"y":466,"width":62,"name":"dabiL","height":68},{"x":839,"y":216,"width":104,"name":"xiaobiL","height":45},{"x":524,"y":650,"width":75,"name":"shouL","height":76},{"x":1,"y":690,"width":97,"name":"jiaoL","height":69},{"x":437,"y":720,"width":67,"name":"xiaotuiL","height":31},{"x":437,"y":650,"width":85,"name":"datuiL","height":68},{"x":598,"y":1,"width":239,"name":"shenti","height":267},{"x":753,"y":270,"width":263,"name":"bozixia","height":194},{"x":450,"y":276,"width":301,"name":"bozishang","height":230},{"x":1,"y":535,"width":107,"name":"toujiaoL","height":153},{"x":945,"y":216,"width":71,"name":"tou1","height":46},{"x":638,"y":508,"width":106,"name":"chujiao","height":112},{"x":110,"y":535,"width":118,"name":"er","height":122},{"x":450,"y":508,"width":186,"name":"zui","height":140},{"x":753,"y":466,"width":200,"name":"toujiaoR","height":156},{"x":839,"y":1,"width":176,"name":"tou","height":213},{"x":110,"y":682,"width":91,"name":"jiaoR","height":105},{"x":955,"y":536,"width":61,"name":"xiaotuiR","height":65},{"x":351,"y":535,"width":86,"name":"datuiR","height":113},{"x":1,"y":1,"width":323,"name":"chibangR2","height":339},{"x":326,"y":650,"width":109,"name":"chibangR1","height":73},{"x":230,"y":535,"width":119,"name":"jianbang","height":100},{"x":326,"y":725,"width":87,"name":"dabiR","height":55},{"x":326,"y":276,"width":122,"name":"xiaobiR","height":61},{"x":230,"y":637,"width":94,"name":"shouR","height":103},{"x":638,"y":624,"width":372,"name":"author","height":56}]} -------------------------------------------------------------------------------- /creator_project/assets/scenes/dragon_bones/texture.json.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "4867dee4-c1b6-4a35-bc39-675c613ff432", 4 | "atlasJson": "{\"imagePath\":\"texture.png\",\"name\":\"NewDragonTest\",\"SubTexture\":[{\"x\":1,\"y\":342,\"width\":447,\"name\":\"tail\",\"height\":191},{\"x\":326,\"y\":1,\"width\":270,\"name\":\"chibangL2\",\"height\":273},{\"x\":1,\"y\":761,\"width\":95,\"name\":\"chibangL1\",\"height\":62},{\"x\":955,\"y\":466,\"width\":62,\"name\":\"dabiL\",\"height\":68},{\"x\":839,\"y\":216,\"width\":104,\"name\":\"xiaobiL\",\"height\":45},{\"x\":524,\"y\":650,\"width\":75,\"name\":\"shouL\",\"height\":76},{\"x\":1,\"y\":690,\"width\":97,\"name\":\"jiaoL\",\"height\":69},{\"x\":437,\"y\":720,\"width\":67,\"name\":\"xiaotuiL\",\"height\":31},{\"x\":437,\"y\":650,\"width\":85,\"name\":\"datuiL\",\"height\":68},{\"x\":598,\"y\":1,\"width\":239,\"name\":\"shenti\",\"height\":267},{\"x\":753,\"y\":270,\"width\":263,\"name\":\"bozixia\",\"height\":194},{\"x\":450,\"y\":276,\"width\":301,\"name\":\"bozishang\",\"height\":230},{\"x\":1,\"y\":535,\"width\":107,\"name\":\"toujiaoL\",\"height\":153},{\"x\":945,\"y\":216,\"width\":71,\"name\":\"tou1\",\"height\":46},{\"x\":638,\"y\":508,\"width\":106,\"name\":\"chujiao\",\"height\":112},{\"x\":110,\"y\":535,\"width\":118,\"name\":\"er\",\"height\":122},{\"x\":450,\"y\":508,\"width\":186,\"name\":\"zui\",\"height\":140},{\"x\":753,\"y\":466,\"width\":200,\"name\":\"toujiaoR\",\"height\":156},{\"x\":839,\"y\":1,\"width\":176,\"name\":\"tou\",\"height\":213},{\"x\":110,\"y\":682,\"width\":91,\"name\":\"jiaoR\",\"height\":105},{\"x\":955,\"y\":536,\"width\":61,\"name\":\"xiaotuiR\",\"height\":65},{\"x\":351,\"y\":535,\"width\":86,\"name\":\"datuiR\",\"height\":113},{\"x\":1,\"y\":1,\"width\":323,\"name\":\"chibangR2\",\"height\":339},{\"x\":326,\"y\":650,\"width\":109,\"name\":\"chibangR1\",\"height\":73},{\"x\":230,\"y\":535,\"width\":119,\"name\":\"jianbang\",\"height\":100},{\"x\":326,\"y\":725,\"width\":87,\"name\":\"dabiR\",\"height\":55},{\"x\":326,\"y\":276,\"width\":122,\"name\":\"xiaobiR\",\"height\":61},{\"x\":230,\"y\":637,\"width\":94,\"name\":\"shouR\",\"height\":103},{\"x\":638,\"y\":624,\"width\":372,\"name\":\"author\",\"height\":56}]}", 5 | "texture": "22acb08d-9262-438d-a089-20b77b62438b", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/dragon_bones/texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/scenes/dragon_bones/texture.png -------------------------------------------------------------------------------- /creator_project/assets/scenes/dragon_bones/texture.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "22acb08d-9262-438d-a089-20b77b62438b", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "texture": { 9 | "ver": "1.0.3", 10 | "uuid": "13566aaa-920e-4aa3-8c97-7d848339ba11", 11 | "rawTextureUuid": "22acb08d-9262-438d-a089-20b77b62438b", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": -3, 16 | "offsetY": 100, 17 | "trimX": 1, 18 | "trimY": 1, 19 | "width": 1016, 20 | "height": 822, 21 | "rawWidth": 1024, 22 | "rawHeight": 1024, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/motionstreak.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "38b55249-e036-4be4-a0d9-c4aaafcf988e", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/motionstreak/anim1.anim: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.AnimationClip", 3 | "_name": "anim1", 4 | "_objFlags": 0, 5 | "_rawFiles": null, 6 | "_duration": 0.67, 7 | "sample": 60, 8 | "speed": 1, 9 | "wrapMode": 2, 10 | "curveData": { 11 | "props": { 12 | "position": [ 13 | { 14 | "frame": 0, 15 | "value": [ 16 | 467, 17 | 353 18 | ], 19 | "motionPath": [] 20 | }, 21 | { 22 | "frame": 0.16666666666666666, 23 | "value": [ 24 | 689, 25 | 630 26 | ], 27 | "motionPath": [] 28 | }, 29 | { 30 | "frame": 0.3333333333333333, 31 | "value": [ 32 | 945, 33 | 351 34 | ], 35 | "motionPath": [] 36 | }, 37 | { 38 | "frame": 0.5, 39 | "value": [ 40 | 631, 41 | 19 42 | ], 43 | "motionPath": [], 44 | "curve": "linear" 45 | }, 46 | { 47 | "frame": 0.6666666666666666, 48 | "value": [ 49 | 466, 50 | 351 51 | ], 52 | "motionPath": [] 53 | } 54 | ] 55 | } 56 | }, 57 | "events": [] 58 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/motionstreak/anim1.anim.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "6b379618-5b80-4cbb-a0eb-ac8cc70054f7", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/motionstreak/motionstreak.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "f0411265-6205-4f4d-9fe8-53cf39d89c4d", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/motionstreak/streak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/scenes/motionstreak/streak.png -------------------------------------------------------------------------------- /creator_project/assets/scenes/motionstreak/streak.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "dbdd0d88-1e19-4f8e-82d9-70f46352e251", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "streak": { 9 | "ver": "1.0.3", 10 | "uuid": "c7daf059-9b9c-4ad0-9d5e-2a3515ee22db", 11 | "rawTextureUuid": "dbdd0d88-1e19-4f8e-82d9-70f46352e251", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 64, 20 | "height": 64, 21 | "rawWidth": 64, 22 | "rawHeight": 64, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/pageview.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "8f0a339f-75e3-442f-896a-8ee218226f87", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/pageview/pageview.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "d00d95c1-18b2-4b47-8b2b-077afccd6f72", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "5f1ba9ea-6037-452d-b6db-c9b00c31f4f3", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/prefab/prefab-test.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "b6d78445-b3f8-4d85-a9ca-81a02d452020", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/prefab/sprite-prefab.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "b0b83f7e-6dbb-4de0-855d-6822632fa3a0", 4 | "asyncLoadAssets": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/richtext.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "489a53ca-b58b-43f8-82cc-4b719a56d345", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/richtext/CreatorRichtext.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "0572189b-6aa5-4c09-9c8d-ff168ef75b07", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/slider.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "377f55cf-55a1-4278-afe9-dda0b46f11b1", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/slider/slider.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "46e937da-e68a-4bdb-9f1c-59556d929425", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/sprites.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "b50171bd-3b05-4520-af88-bacc91b20e3f", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/sprites/CreatorSprites.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "cda0dfbc-11cd-41e8-be72-0b8e98abf0a6", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/tilemap.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "2aa5bcd3-e07e-4ad9-8aa9-d27f2de961eb", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/tilemap/CreatorTilemap.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "a86dc02d-a7a1-4871-84b8-b6adcc7e88b7", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/toggle.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "8a94e8ee-ee5a-4e5b-b08a-d359d126fb14", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/toggle/toggle.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "5b7bb25a-bd09-4bd1-a61b-47f394cba0ab", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/toggle_group.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "024b0959-8a14-4e56-abf5-d3ee8fc67a3d", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/toggle_group/toggle_group.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "160469fe-654a-4e3a-a0a3-66c250db8bcd", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/ui.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "819089d6-e2a1-4c3e-8cc0-1c9e60e2c2c0", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/ui/CreatorUI.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "ab8ec530-3f48-4940-a960-17333f6fe7dc", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/video.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "a267ce40-598f-4a12-8506-761038dae495", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/video/VideoPlayer.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "629a3e35-1b9b-4f6d-bb18-465badd06aca", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/video/cocosvideo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/scenes/video/cocosvideo.mp4 -------------------------------------------------------------------------------- /creator_project/assets/scenes/video/cocosvideo.mp4.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "0c52abdc-515c-4cde-96a5-87abc4ca8a64", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/webview.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "dcc14d85-3f39-44ac-b95f-1280acab64ae", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /creator_project/assets/scenes/webview/WebView.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "67e46e4e-820e-468e-8dc3-9e639f005020", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /creator_project/assets/test_polygon.plist.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.4", 3 | "uuid": "ebceda0f-2a27-4ed9-a9be-d4e3409e05c5", 4 | "rawTextureUuid": "ec561d4c-4b3c-4ade-a003-28a49c6f5822", 5 | "size": { 6 | "width": 387, 7 | "height": 157 8 | }, 9 | "type": "Texture Packer", 10 | "subMetas": { 11 | "grossinis_sister1.png": { 12 | "ver": "1.0.3", 13 | "uuid": "9da94805-0d1b-43c3-910b-fd28d244faf5", 14 | "rawTextureUuid": "ec561d4c-4b3c-4ade-a003-28a49c6f5822", 15 | "trimType": "auto", 16 | "trimThreshold": 1, 17 | "rotated": false, 18 | "offsetX": 0, 19 | "offsetY": -11, 20 | "trimX": 336, 21 | "trimY": 1, 22 | "width": 50, 23 | "height": 116, 24 | "rawWidth": 52, 25 | "rawHeight": 139, 26 | "borderTop": 0, 27 | "borderBottom": 0, 28 | "borderLeft": 0, 29 | "borderRight": 0, 30 | "spriteType": "normal", 31 | "subMetas": {} 32 | }, 33 | "grossinis_sister2.png": { 34 | "ver": "1.0.3", 35 | "uuid": "6955bb6d-902b-4fa7-b9a0-0c809f3bf5b7", 36 | "rawTextureUuid": "ec561d4c-4b3c-4ade-a003-28a49c6f5822", 37 | "trimType": "auto", 38 | "trimThreshold": 1, 39 | "rotated": false, 40 | "offsetX": 0, 41 | "offsetY": -2, 42 | "trimX": 279, 43 | "trimY": 26, 44 | "width": 55, 45 | "height": 130, 46 | "rawWidth": 56, 47 | "rawHeight": 138, 48 | "borderTop": 0, 49 | "borderBottom": 0, 50 | "borderLeft": 0, 51 | "borderRight": 0, 52 | "spriteType": "normal", 53 | "subMetas": {} 54 | }, 55 | "island_polygon.png": { 56 | "ver": "1.0.3", 57 | "uuid": "2ee7b50a-17eb-48f2-8c62-b3db758676ef", 58 | "rawTextureUuid": "ec561d4c-4b3c-4ade-a003-28a49c6f5822", 59 | "trimType": "auto", 60 | "trimThreshold": 1, 61 | "rotated": false, 62 | "offsetX": 16, 63 | "offsetY": 7, 64 | "trimX": 1, 65 | "trimY": 1, 66 | "width": 287, 67 | "height": 152, 68 | "rawWidth": 320, 69 | "rawHeight": 200, 70 | "borderTop": 0, 71 | "borderBottom": 0, 72 | "borderLeft": 0, 73 | "borderRight": 0, 74 | "spriteType": "normal", 75 | "subMetas": {} 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /creator_project/assets/test_polygon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/test_polygon.png -------------------------------------------------------------------------------- /creator_project/assets/test_polygon.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "ec561d4c-4b3c-4ade-a003-28a49c6f5822", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "test_polygon": { 9 | "ver": "1.0.3", 10 | "uuid": "7855a160-16fc-4f33-b310-4d48fa4315ac", 11 | "rawTextureUuid": "ec561d4c-4b3c-4ade-a003-28a49c6f5822", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0.5, 17 | "trimX": 3, 18 | "trimY": 2, 19 | "width": 381, 20 | "height": 152, 21 | "rawWidth": 387, 22 | "rawHeight": 157, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /creator_project/assets/ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/assets/ui.png -------------------------------------------------------------------------------- /creator_project/assets/ui.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "f2755924-c358-4c68-a8ab-77cf4eafb922", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "ui": { 9 | "ver": "1.0.3", 10 | "uuid": "1f46fbaf-7f42-4fef-8f8c-57f7e8f73103", 11 | "rawTextureUuid": "f2755924-c358-4c68-a8ab-77cf4eafb922", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 15.5, 17 | "trimX": 2, 18 | "trimY": 2, 19 | "width": 124, 20 | "height": 221, 21 | "rawWidth": 128, 22 | "rawHeight": 256, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /creator_project/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs" 5 | }, 6 | "exclude": [ 7 | "node_modules", 8 | "library", 9 | "local", 10 | "settings", 11 | "temp" 12 | ] 13 | } -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/bin/flatc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/packages/creator-luacpp-support/bin/flatc -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/bin/flatc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos2d/creator_to_cocos2dx/32aae979263570c2fc69c9074519e59a501326b6/creator_project/packages/creator-luacpp-support/bin/flatc.exe -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/Constants.js: -------------------------------------------------------------------------------- 1 | /* jslint node: true, sub: true, esversion: 6, browser: true */ 2 | /* globals Editor */ 3 | 4 | "use strict"; 5 | 6 | const Path = require('path'); 7 | 8 | class Constants{}; 9 | 10 | Constants.PACKAGE_NAME = 'creator-luacpp-support'; 11 | // root of the this plugin 12 | Constants.PACKAGE_PATH = Editor.url('packages://' + Constants.PACKAGE_NAME + '/'); 13 | // root of creator project 14 | if (process && process.type === 'renderer') 15 | Constants.PROJECT_PATH = Editor.remote.projectInfo.path; 16 | else 17 | Constants.PROJECT_PATH = Editor.projectInfo.path; 18 | // path of `assets` folder 19 | Constants.ASSETS_PATH = Path.join(Constants.PROJECT_PATH, 'assets'); 20 | // path of `temp` folder 21 | Constants.TEMP_PATH = Path.join(Constants.PROJECT_PATH, 'temp'); 22 | // path of `temp/internal` 23 | Constants.INTERNAL_PATH = Path.join(Constants.TEMP_PATH, 'internal'); 24 | // path of `CreatorReader.fbs` 25 | Constants.CREATOR_READER_FBS = Path.join(Constants.PACKAGE_PATH, 'CreatorReader.fbs'); 26 | // path of `flatc` 27 | Constants.FLATC = Path.join(Constants.PACKAGE_PATH, 'bin/flatc'); 28 | // path of `convert_fire_to_json.py`c 29 | Constants.CONVERT_FIRE_TO_JSON_PY = Path.join(Constants.PACKAGE_PATH, 'convert_fire_to_json.py'); 30 | // path of generated .json files 31 | Constants.JSON_PATH = Path.join(Constants.PROJECT_PATH, 'json'); 32 | // path of generated .ccreator files 33 | Constants.CCREATOR_PATH = Path.join(Constants.PROJECT_PATH, 'ccreator'); 34 | // path of reader folder 35 | Constants.READER_PATH = Path.join(Constants.PACKAGE_PATH, 'reader'); 36 | // the folder that all resources are copied to 37 | Constants.RESOURCE_FOLDER_NAME = 'creator'; 38 | 39 | Constants.VERDION = '0.4.0'; 40 | 41 | Constants.PROFILE_DEFAULTS = { 42 | setup: false, 43 | path: '', 44 | autoBuild: false, 45 | exportResourceOnly: false, 46 | exportResourceDynamicallyLoaded: false 47 | }; 48 | 49 | module.exports = Constants; 50 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/Project.js: -------------------------------------------------------------------------------- 1 | 2 | /* jslint node: true, sub: true, esversion: 6 */ 3 | /* globals Editor */ 4 | 5 | "use strict"; 6 | 7 | const Fs = require('fire-fs'); 8 | const Path = require('path'); 9 | 10 | const printlog = Editor ? Editor.log : console.log; 11 | function tostring(v) { 12 | return v === null ? '' : v.toString(); 13 | } 14 | 15 | module.exports = class Project { 16 | constructor(state) { 17 | this.path = state ? state.path : ''; 18 | this.autoBuild = state ? state.autoBuild : true; 19 | } 20 | 21 | validate() { 22 | if (typeof this.path !== 'string' || this.path === '') { 23 | Editor.warn('[LuaCpp Support] not set Target Project Path'); 24 | return false; 25 | } 26 | 27 | try { 28 | let stat = Fs.statSync(this.path); 29 | if (!stat.isDirectory()) { 30 | Editor.warn('[LuaCpp Support] ' + this.path + ' is not directory'); 31 | return false; 32 | } 33 | } catch (e) { 34 | Editor.warn('[LuaCpp Support] invalid path: ' + this.path); 35 | return false; 36 | } 37 | 38 | return true; 39 | } 40 | 41 | printlog() { 42 | printlog('-- dump project'); 43 | printlog(' path: ' + tostring(this.path)); 44 | printlog(' autoBuild: ' + (this.autoBuild ? 'YES' : 'NO')); 45 | } 46 | 47 | dumpState(state) { 48 | if (!state) { 49 | state = {}; 50 | } 51 | state.path = this.path; 52 | state.autoBuild = this.autoBuild; 53 | return state; 54 | } 55 | }; 56 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/WorkerBase.js: -------------------------------------------------------------------------------- 1 | 2 | /* jslint node: true, sub: true, esversion: 6, browser: true */ 3 | /* globals Editor */ 4 | 5 | "use strict"; 6 | 7 | const Electron = require('electron'); 8 | 9 | class WorkerBase { 10 | constructor(opts) { 11 | this._time = new Date(); 12 | this._progress = 0; 13 | this._opts = opts; 14 | this._debug = opts.debug; 15 | } 16 | 17 | _updateProgress(step) { 18 | this._progress += step; 19 | Editor.Ipc.sendToAll('creator-luacpp-support:state-changed', 20 | 'progress ' + Math.floor(this._progress) + '%', 21 | this._progress); 22 | } 23 | 24 | _execTime(tag) { 25 | let current = new Date(); 26 | if (this._debug) { 27 | let times = (current.getTime() - this._time.getTime()) / 1000; 28 | Editor.log('[creator-luacpp-support] [' + tag + '] ' + times.toString() + 's'); 29 | } 30 | this._time = current; 31 | } 32 | } 33 | 34 | 35 | function registerWorker(workerClass, runEvent) { 36 | Electron.ipcRenderer.on('creator-luacpp-support:' + runEvent, (event, state, opts) => { 37 | let worker = new workerClass(opts); 38 | worker.run(state, () => { 39 | event.reply(); 40 | }); 41 | }); 42 | } 43 | 44 | module.exports.WorkerBase = WorkerBase; 45 | module.exports.registerWorker = registerWorker; 46 | 47 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/parser/Button.js: -------------------------------------------------------------------------------- 1 | const Node = require('./Node'); 2 | const Utils = require('../Utils'); 3 | const get_sprite_frame_name_by_uuid = require('./Utils').get_sprite_frame_name_by_uuid; 4 | 5 | class Button extends Node { 6 | constructor(data) { 7 | super(data); 8 | this._jsonNode.object_type = 'Button'; 9 | } 10 | 11 | parse_properties() { 12 | super.parse_properties(); 13 | 14 | this._properties = {node: this._properties}; 15 | let spr_component = Node.get_node_component_of_type(this._node_data, 'cc.Sprite'); 16 | let but_component = Node.get_node_component_of_type(this._node_data, 'cc.Button'); 17 | 18 | this._properties.ignoreContentAdaptWithSize = false; 19 | 20 | // normal sprite: get from sprite component 21 | if (spr_component && spr_component._spriteFrame) 22 | this._properties.spriteFrameName = get_sprite_frame_name_by_uuid(spr_component._spriteFrame.__uuid__); 23 | 24 | // transition 25 | let transition = but_component.transition; 26 | this._properties.transition = transition; 27 | if (transition == 1) // COLOR transition 28 | Utils.log('Button COLOR transition is not supported'); 29 | if (transition == 3) // SCALE transition 30 | this._properties.zoomScale = but_component.zoomScale; 31 | if (transition == 2) { 32 | // SRPITE transition 33 | // pressed sprite 34 | if (but_component.pressedSprite) 35 | this._properties.pressedSpriteFrameName = get_sprite_frame_name_by_uuid(but_component.pressedSprite.__uuid__); 36 | // disabled sprite 37 | if (but_component._N$disabledSprite) 38 | this._properties.disabledSpriteFrameName = get_sprite_frame_name_by_uuid(but_component._N$disabledSprite.__uuid__); 39 | } 40 | } 41 | } 42 | 43 | module.exports = Button; -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/parser/Canvas.js: -------------------------------------------------------------------------------- 1 | const Node = require('./Node'); 2 | let state = require('./Global').state; 3 | 4 | class Canvas extends Node { 5 | constructor(data) { 6 | super(data); 7 | 8 | let component = Node.get_node_component_of_type(this._node_data, 'cc.Canvas'); 9 | state._design_resolution = component._designResolution; 10 | state._fit_width = component._fitWidth; 11 | state._fit_height = component._fitHeight; 12 | 13 | this._jsonNode.object_type = 'Node'; 14 | } 15 | } 16 | 17 | module.exports = Canvas; 18 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/parser/Collider.js: -------------------------------------------------------------------------------- 1 | class Collider { 2 | static parse(data) { 3 | let result = {}; 4 | 5 | let offset = data._offset; 6 | result.offset = { 7 | x: offset.x, 8 | y: offset.y 9 | }; 10 | 11 | let type = data.__type__; 12 | if (type === 'cc.CircleCollider') { 13 | result.type = 'CircleCollider'; 14 | result.radius = data._radius; 15 | } 16 | else if (type === 'cc.PolygonCollider') { 17 | result.type = 'PolygonCollider'; 18 | 19 | let points = data.points; 20 | result.points = []; 21 | for (let i = 0, len = points.length; i < len; ++i) { 22 | let point = points[i]; 23 | result.points.push({x: point.x, y: point.y}); 24 | } 25 | } 26 | else if (type === 'cc.BoxCollider') { 27 | result.type = 'BoxCollider'; 28 | 29 | let size = data._size; 30 | result.size = {w: size.width, h: size.height}; 31 | } 32 | 33 | return result; 34 | } 35 | } 36 | 37 | 38 | module.exports = Collider; -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/parser/DragonBones.js: -------------------------------------------------------------------------------- 1 | const Node = require('./Node'); 2 | const Utils = require('./Utils'); 3 | const state = require('./Global').state; 4 | const fs = require('fs'); 5 | const path = require('path'); 6 | 7 | class DragonBones extends Node { 8 | constructor(data) { 9 | super(data); 10 | this._jsonNode.object_type = 'DragonBones'; 11 | } 12 | 13 | parse_properties() { 14 | super.parse_properties(); 15 | this._properties = {node: this._properties}; 16 | 17 | let dragonbones_armature_display = Node.get_node_component_of_type(this._node_data, 'dragonBones.ArmatureDisplay'); 18 | this.add_property_str('armature', '_armatureName', dragonbones_armature_display); 19 | this.add_property_str('animation', '_animationName', dragonbones_armature_display); 20 | this.add_property_int('timeScale', '_N$timeScale', dragonbones_armature_display); 21 | this.add_property_int('playTimes', 'playTimes', dragonbones_armature_display); 22 | 23 | // bones data path and bone data name 24 | let bone_asset = dragonbones_armature_display._N$dragonAsset; 25 | if (bone_asset) { 26 | let bone_data_path_info = Utils.get_relative_full_path_by_uuid(bone_asset.__uuid__); 27 | this._properties.boneDataPath = state._assetpath + bone_data_path_info.relative_path; 28 | 29 | // bone data name 30 | let bone_data = fs.readFileSync(bone_data_path_info.fullpath); 31 | let bone_data_json = JSON.parse(bone_data); 32 | this._properties.boneDataName = bone_data_json.name; 33 | } 34 | 35 | // texture data path and texture path 36 | let texture_atlas_asset = dragonbones_armature_display._N$dragonAtlasAsset; 37 | if (texture_atlas_asset) { 38 | // texture data 39 | let texture_atlas_data_path_info = Utils.get_relative_full_path_by_uuid(texture_atlas_asset.__uuid__); 40 | this._properties.textureDataPath = state._assetpath + texture_atlas_data_path_info.relative_path; 41 | 42 | // add image path to copy resources vector 43 | let texture_atlas_data = fs.readFileSync(texture_atlas_data_path_info.fullpath); 44 | let texture_atlas_data_json = JSON.parse(texture_atlas_data); 45 | let image_file_name = texture_atlas_data_json.imagePath; 46 | let image_relative_path = path.join(path.dirname(texture_atlas_data_path_info.relative_path), image_file_name); 47 | let image_full_path = path.join(path.dirname(texture_atlas_data_path_info.fullpath), image_file_name); 48 | // image uuid means nothing, just need it in state._uuid 49 | let image_uuid = texture_atlas_asset.__uuid__ + '_image'; 50 | state._uuid[image_uuid] = {fullpath: image_full_path, 51 | relative_path: image_relative_path}; 52 | } 53 | } 54 | } 55 | 56 | module.exports = DragonBones; -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/parser/EditBox.js: -------------------------------------------------------------------------------- 1 | const Node = require('./Node'); 2 | const Utils = require('./Utils'); 3 | 4 | class EditBox extends Node { 5 | constructor(data) { 6 | super(data); 7 | this._jsonNode.object_type = 'EditBox'; 8 | } 9 | 10 | parse_properties() { 11 | super.parse_properties(); 12 | 13 | this._properties = {node: this._properties}; 14 | 15 | let component = Node.get_node_component_of_type(this._node_data, 'cc.EditBox'); 16 | 17 | // background image is needed by cocos2d-x's EditBox 18 | if (!component._N$backgroundImage) 19 | Utils.log("Error:EditBox background image is needed by cocos2d-x!"); 20 | this._properties.backgroundImage = Utils.get_sprite_frame_name_by_uuid(component._N$backgroundImage.__uuid__); 21 | 22 | this._properties.returnType = EditBox.RETURN_TYPE[component._N$returnType]; 23 | this._properties.inputFlag = EditBox.INPUT_FLAG[component._N$inputFlag]; 24 | this._properties.inputMode = EditBox.INPUT_MODE[component._N$inputMode]; 25 | this.add_property_int('fontSize', '_N$fontSize', component); 26 | this.add_property_rgb('fontColor', '_N$fontColor', component); 27 | this.add_property_str('placeholder', '_N$placeholder', component); 28 | this.add_property_int('placeholderFontSize', '_N$placeholderFontSize', component); 29 | this.add_property_rgb('placeholderFontColor', '_N$placeholderFontColor', component); 30 | this.add_property_int('maxLength', '_N$maxLength', component); 31 | this.add_property_str('text', '_string', component); 32 | } 33 | } 34 | EditBox.INPUT_MODE = ['Any', 'EmailAddress', 'Numeric', 'PhoneNumber', 'URL', 'Decime', 'SingleLine']; 35 | EditBox.INPUT_FLAG = ['Password', 'Sensitive', 'InitialCapsWord', 'InitialCapsSentence', 'InitialCapsAllCharacters', 'LowercaseAllCharacters']; 36 | EditBox.RETURN_TYPE = ['Default', 'Done', 'Send', 'Search', 'Go']; 37 | 38 | module.exports = EditBox; -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/parser/Global.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Singleton 3 | */ 4 | class State { 5 | constructor() { 6 | this.reset(); 7 | } 8 | 9 | reset() { 10 | this._filename = ''; 11 | 12 | // prefix path of all assets 13 | this._assetpath = ''; 14 | 15 | // the .fire file being parsed 16 | this._json_data = []; 17 | 18 | // record all sprite frames 19 | // key is uuid, value is the information of the sprite frame 20 | this._sprite_frames = {}; 21 | 22 | // contains all resource paths 23 | // key is uuid, value is { relative_path: '', full_path: '' } 24 | // need to use the information to copy resources 25 | this._uuid = {}; 26 | 27 | this._design_resolution = null; 28 | 29 | // clips 30 | // key is the uuid, value is the animation 31 | this._clips = {}; 32 | } 33 | } 34 | 35 | class SpriteTypes { 36 | 37 | } 38 | SpriteTypes.SIMPLE = 0; 39 | SpriteTypes.SLICED = 1; 40 | SpriteTypes.TILED = 2; 41 | SpriteTypes.FILLED = 3; 42 | 43 | module.exports.state = new State(); 44 | module.exports.SpriteTypes = SpriteTypes; -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/parser/Label.js: -------------------------------------------------------------------------------- 1 | const Node = require('./Node'); 2 | const Utils = require('./Utils'); 3 | const state = require('./Global').state; 4 | 5 | class Label extends Node { 6 | constructor(data) { 7 | super(data); 8 | this._label_text = ''; 9 | this._jsonNode.object_type = 'Label'; 10 | } 11 | 12 | parse_properties() { 13 | super.parse_properties(); 14 | 15 | // Move Node properties into 'node' and clean _properties 16 | this._properties = {node: this._properties}; 17 | 18 | let component = Node.get_node_component_of_type(this._node_data, 'cc.Label'); 19 | 20 | let is_system_font = component._isSystemFontUsed; 21 | this._properties.fontSize = component._fontSize; 22 | this._properties.labelText = component._N$string; 23 | 24 | // outline 25 | let outline_component = Node.get_node_component_of_type(this._node_data, 'cc.LabelOutline'); 26 | if (outline_component) { 27 | let color = outline_component._color; 28 | let outline_info = { 29 | color: { 30 | r: color.r, 31 | g: color.g, 32 | b: color.b, 33 | a: color.a 34 | }, 35 | width: outline_component._width 36 | } 37 | this._properties.outline = outline_info; 38 | } 39 | 40 | // alignments 41 | this._properties.horizontalAlignment = Label.H_ALIGNMENTS[component._N$horizontalAlign]; 42 | this._properties.verticalAlignment = Label.V_ALIGNMENTS[component._N$verticalAlign]; 43 | 44 | this._properties.overflowType = Label.OVERFLOW_TYPE[component._N$overflow]; 45 | this.add_property_bool('enableWrap', '_enableWrapText', component); 46 | 47 | if (is_system_font) { 48 | this._properties.fontType = 'System'; 49 | this._properties.fontName = 'arial'; 50 | } 51 | else { 52 | let fontName = Utils.get_font_path_by_uuid(component._N$file.__uuid__); 53 | this._properties.fontName = state._assetpath + fontName; 54 | if (fontName.endsWith('.ttf')) 55 | this._properties.fontType = 'TTF'; 56 | else if (fontName.endsWith('.fnt')) { 57 | this._properties.fontType = 'BMFont'; 58 | this.add_property_int('fontSize', '_fontSize', component); 59 | } 60 | else 61 | throw 'can not find font file for uuid: ' + component._N$file.__uuid__; 62 | 63 | this.add_property_int('lineHeight' ,'_lineHeight', component); 64 | } 65 | } 66 | } 67 | Label.H_ALIGNMENTS = ['Left', 'Center', 'Right']; 68 | Label.V_ALIGNMENTS = ['Top', 'Center', 'Bottom']; 69 | Label.OVERFLOW_TYPE = ['None', 'Clamp', 'Shrink', 'ResizeHeight']; 70 | 71 | module.exports = Label; -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/parser/Mask.js: -------------------------------------------------------------------------------- 1 | const Node = require('./Node'); 2 | const Utils = require('./Utils'); 3 | const state = require('./Global').state; 4 | 5 | class Mask extends Node { 6 | constructor(data) { 7 | super(data); 8 | this._jsonNode.object_type = 'Mask'; 9 | } 10 | 11 | parse_properties() { 12 | super.parse_properties(); 13 | 14 | // Move Node properties into 'node' and clean _properties 15 | this._properties = {node: this._properties}; 16 | 17 | let component = Node.get_node_component_of_type(this._node_data, 'cc.Mask'); 18 | 19 | this._properties.type = Mask.MASK_TYPES[component._type]; 20 | this.add_property_bool('inverted', '_N$inverted', component); 21 | 22 | if (this._properties.type === 'Ellipse') 23 | this.add_property_int('segments', '_segements', component); 24 | 25 | if (this._properties.type === 'ImageStencil') { 26 | this.add_property_int('alphaThreshold', '_N$alphaThreshold', component); 27 | this._properties.spriteFrame = Utils.get_sprite_frame_name_by_uuid(component._N$spriteFrame.__uuid__); 28 | } 29 | } 30 | } 31 | Mask.MASK_TYPES = ['Rect', 'Ellipse', 'ImageStencil']; 32 | 33 | module.exports = Mask; -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/parser/MotionStreak.js: -------------------------------------------------------------------------------- 1 | const Node = require('./Node'); 2 | const Utils = require('./Utils'); 3 | const state = require('./Global').state; 4 | 5 | class MotionStreak extends Node { 6 | constructor(data) { 7 | super(data); 8 | this._jsonNode.object_type = 'MotionStreak'; 9 | } 10 | 11 | parse_properties() { 12 | // Don't have to parse children. 13 | super.parse_node_properties(); 14 | 15 | // Move Node properties into 'node' and clean _properties. 16 | this._properties = {node: this._properties}; 17 | 18 | let motion_streak_comp = Node.get_node_component_of_type(this._node_data, 'cc.MotionStreak'); 19 | this.add_property_int('timeToFade', '_fadeTime', motion_streak_comp); 20 | this.add_property_int('minSeg', '_minSeg', motion_streak_comp); 21 | this.add_property_int('strokeWidth', '_stroke', motion_streak_comp); 22 | this.add_property_rgb('strokeColor', '_color', motion_streak_comp); 23 | this.add_property_bool('fastMode', '_fastMode', motion_streak_comp); 24 | 25 | if (motion_streak_comp._texture.__uuid__) { 26 | let path = Utils.get_relative_full_path_by_uuid(motion_streak_comp._texture.__uuid__); 27 | this._properties.texturePath = state._assetpath + path.relative_path; 28 | } 29 | else 30 | Utils.log('Error: MotionStreak: missing texture.'); 31 | } 32 | } 33 | 34 | module.exports = MotionStreak; -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/parser/ParticleSystem.js: -------------------------------------------------------------------------------- 1 | const Node = require('./Node'); 2 | const Utils = require('./Utils'); 3 | const state = require('./Global').state; 4 | 5 | class ParticleSystem extends Node { 6 | constructor(data) { 7 | super(data); 8 | this._jsonNode.object_type = 'Particle'; 9 | } 10 | 11 | parse_properties() { 12 | super.parse_properties(); 13 | 14 | this._properties = {node: this._properties}; 15 | 16 | let component = Node.get_node_component_of_type(this._node_data, 'cc.ParticleSystem'); 17 | this._properties.particleFilename = state._assetpath + this.get_particle_system_path_by_uuid(component._file.__uuid__); 18 | 19 | // creator may change the texture 20 | if (component._texture) 21 | this._properties.texturePath = state._assetpath + this.get_particle_system_path_by_uuid(component._texture.__uuid__); 22 | } 23 | 24 | get_particle_system_path_by_uuid(uuid) { 25 | let path_info = Utils.get_relative_full_path_by_uuid(uuid); 26 | return path_info.relative_path; 27 | } 28 | } 29 | 30 | module.exports = ParticleSystem; -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/parser/Prefab.js: -------------------------------------------------------------------------------- 1 | const state = require('./Global').state; 2 | const fs = require('fs'); 3 | const Node = require('./Node'); 4 | 5 | /** 6 | * Prefab is not a real Node type. The real type will be changed by parsing prefab files. 7 | */ 8 | class Prefab extends Node { 9 | constructor(data) { 10 | super(data); 11 | // real type will be changed later 12 | this._jsonNode.object_type = 'Prefab'; 13 | } 14 | 15 | parse_properties() { 16 | super.parse_properties(); 17 | 18 | // parse content in prefab file 19 | 20 | let prefab = this._node_data._prefab; 21 | 22 | // get root node of prefab 23 | let prefab_node_data = state._json_data[prefab.__id__]; 24 | let prefab_json = this._get_json_of_prefab(prefab_node_data); 25 | let root_node_index = prefab_json[0].data.__id__; 26 | let root_node_data = prefab_json[root_node_index]; 27 | 28 | // get type of root node, should modify state._json_data to prefab file content 29 | // when parsing prefab files 30 | let old_state_json_data = state._json_data; 31 | state._json_data = prefab_json; 32 | let components = Node.get_node_components(root_node_data) 33 | let type = Node.guess_type_from_components(components); 34 | 35 | // create corresponding object for root node 36 | const Utils = require('./Utils'); 37 | let prefab_root_node_obj = Utils.create_node(type, root_node_data); 38 | 39 | // modify the object_type to real type 40 | this._jsonNode.object_type = prefab_root_node_obj._jsonNode.object_type; 41 | 42 | // reset this._properties and adjust some properties 43 | let original_properties = this._properties; 44 | this._properties = prefab_root_node_obj._properties; 45 | this._adjust_properties(original_properties, 'contentSize'); 46 | this._adjust_properties(original_properties, 'enabled'); 47 | this._adjust_properties(original_properties, 'name'); 48 | this._adjust_properties(original_properties, 'globalZOrder'); 49 | this._adjust_properties(original_properties, 'localZOrder'); 50 | this._adjust_properties(original_properties, 'position'); 51 | this._adjust_properties(original_properties, 'rotationSkewX'); 52 | this._adjust_properties(original_properties, 'rotationSkewY'); 53 | 54 | this._node_data = root_node_data; 55 | super.parse_children(); 56 | 57 | // reset state._json_data 58 | state._json_data = old_state_json_data; 59 | } 60 | 61 | _adjust_properties(original_properties, name) { 62 | // if root node is an empty Node, then its Node properties is `this._properties` 63 | let node_properties = this._properties.node || this._properties; 64 | node_properties[name] = original_properties[name]; 65 | } 66 | 67 | _get_json_of_prefab(prefab_node) { 68 | let prefab_file_path = Editor.remote.assetdb.uuidToFspath(prefab_node.asset.__uuid__); 69 | let contents = fs.readFileSync(prefab_file_path); 70 | return JSON.parse(contents); 71 | } 72 | } 73 | 74 | module.exports = Prefab; 75 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/parser/ProgressBar.js: -------------------------------------------------------------------------------- 1 | const Node = require('./Node'); 2 | const state = require('./Global').state; 3 | const Utils = require('./Utils'); 4 | 5 | class ProgressBar extends Node { 6 | constructor(data) { 7 | super(data); 8 | this._jsonNode.object_type = 'ProgressBar'; 9 | } 10 | 11 | parse_properties() { 12 | // 1st: parse self 13 | this.parse_node_properties(); 14 | this._properties = {node: this._properties}; 15 | 16 | // background sprite 17 | let bg_component = Node.get_node_component_of_type(this._node_data, 'cc.Sprite'); 18 | if (bg_component._spriteFrame) 19 | this._properties.backgroundSpriteFrameName = state._assetpath + Utils.get_sprite_frame_name_by_uuid(bg_component._spriteFrame.__uuid__); 20 | 21 | let bar_component = Node.get_node_component_of_type(this._node_data, 'cc.ProgressBar'); 22 | this._properties.percent = bar_component._N$progress * 100; 23 | 24 | // texture of progress bar 25 | let bar_sprite = bar_component._N$barSprite; 26 | if (bar_sprite) { 27 | let bar_sprite_data = state._json_data[bar_sprite.__id__]; 28 | let bar_sprite_uuid = bar_sprite_data._spriteFrame.__uuid__; 29 | this._properties.barSpriteFrameName = state._assetpath + Utils.get_sprite_frame_name_by_uuid(bar_sprite_uuid); 30 | this._properties.barSpriteType = bar_sprite_data._type; 31 | 32 | // should remove the child: bar sprite node 33 | let bar_sprite_node_id = state._json_data[bar_sprite.__id__].node.__id__; 34 | Utils.remove_child_by_id(this, bar_sprite_node_id); 35 | } 36 | 37 | this._properties.reverse = bar_component._N$reverse; 38 | 39 | // 2nd: parse children 40 | this._node_data._children.forEach(function(item) { 41 | this.parse_child(item.__id__); 42 | }.bind(this)); 43 | } 44 | } 45 | 46 | module.exports = ProgressBar; -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/core/parser/RichText.js: -------------------------------------------------------------------------------- 1 | const Node = require('./Node'); 2 | const Label = require('./Label'); 3 | const Utils = require('./Utils'); 4 | const state = require('./Global').state; 5 | 6 | class RichText extends Node { 7 | constructor(data) { 8 | super(data); 9 | this._label_text = ''; 10 | this._jsonNode.object_type = 'RichText'; 11 | } 12 | 13 | parse_properties() { 14 | super.parse_properties(); 15 | 16 | this._properties = {node: this._properties}; 17 | 18 | let component = Node.get_node_component_of_type(this._node_data, 'cc.RichText'); 19 | 20 | // -> 21 | var text = component._N$string; 22 | let regex = /( for raw strings 26 | text = '' + text + ''; 27 | 28 | // add sprite frames if there is img component 29 | if (component._N$imageAtlas) { 30 | // find sprite frame name 31 | regex = / -> 41 | let resource_json_content = Utils.get_sprite_frame_json_by_uuid(resource_uuid); 42 | let resource_size = {width: resource_json_content.content.originalSize[0], 43 | height: resource_json_content.content.originalSize[1]}; 44 | text = text.replace(/(Setup Target Project v{{version}} 3 | 4 | 5 | 6 | 10 | 11 | {{buildState}} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | ... 20 | Open 21 | 22 | 23 | 24 | 25 | 26 | Export Resource Only 27 | 28 | 29 | Export Resource Dynamically Loaded 30 | 31 | 32 | 33 | 34 | 35 | Auto Build After Scene Saved 36 | 37 | 38 | 39 | 40 | 57 | 58 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/panels/style.css: -------------------------------------------------------------------------------- 1 | 2 | @import url('app://bower_components/fontawesome/css/font-awesome.min.css'); 3 | 4 | :host { 5 | display: flex; 6 | flex-direction: column; 7 | } 8 | 9 | h2 { 10 | margin: 20px 20px 0 20px; 11 | font-size: 26px; 12 | color: #DDD; 13 | } 14 | 15 | header { 16 | height: 26px; 17 | display: flex; 18 | margin: 0 20px; 19 | padding: 15px 0; 20 | border-bottom: 1px solid #666; 21 | } 22 | 23 | .version { 24 | font-weight: normal; 25 | font-size: 10px; 26 | color: white; 27 | background-color: #53bde0; 28 | border-radius: 4px; 29 | padding: 2px 4px; 30 | position: relative; 31 | top: -12px; 32 | } 33 | 34 | .progress { 35 | flex: 14; 36 | margin: 3px 15px 3px 0; 37 | position: relative; 38 | } 39 | .progress ui-progress { 40 | width: 100%; 41 | } 42 | 43 | .state { 44 | position: absolute; 45 | top: 0; 46 | left: 0; 47 | width: 100%; 48 | line-height: 16px; 49 | margin: 0 15px 0 0; 50 | overflow: hidden; 51 | text-overflow: ellipsis; 52 | white-space: nowrap; 53 | text-align: center; 54 | color: white; 55 | } 56 | 57 | .state[state=failed] { 58 | color: red; 59 | } 60 | 61 | section { 62 | margin: 10px 10px; 63 | padding: 0 10px; 64 | flex: 1; 65 | overflow-y: auto; 66 | } 67 | .fix-width { 68 | width: 1px; 69 | } 70 | 71 | .height-limited { 72 | max-height: 240px; 73 | } 74 | 75 | .height-limited ui-box-container { 76 | max-height: 228px; 77 | min-height: 100px; 78 | } 79 | 80 | ui-box-container li { 81 | margin: 4px 0; 82 | } 83 | 84 | ui-box-container li .fa.fa-star { 85 | color: yellow; 86 | } 87 | 88 | footer { 89 | padding: 10px 0; 90 | justify-content: flex-end; 91 | } 92 | 93 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | cpp_src := \ 4 | animation/AnimateClip.cpp \ 5 | animation/AnimationClip.cpp \ 6 | animation/AnimationManager.cpp \ 7 | animation/Easing.cpp \ 8 | animation/Bezier.cpp \ 9 | collider/Collider.cpp \ 10 | collider/ColliderManager.cpp \ 11 | collider/Contract.cpp \ 12 | collider/Intersection.cpp \ 13 | CreatorReader.cpp \ 14 | ui/PageView.cpp \ 15 | ui/RichtextStringVisitor.cpp 16 | 17 | # for cpp 18 | include $(CLEAR_VARS) 19 | path := $(LOCAL_PATH) 20 | 21 | LOCAL_MODULE := creator_reader 22 | LOCAL_MODULE_FILENAME := libcreatorreader 23 | LOCAL_ARM_MODE := arm 24 | LOCAL_SRC_FILES := $(cpp_src) 25 | 26 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/. 27 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/. 28 | LOCAL_STATIC_LIBRARIES := cocos2dx_static 29 | LOCAL_STATIC_LIBRARIES += dragonbones_static 30 | 31 | include $(BUILD_STATIC_LIBRARY) 32 | 33 | # for lua 34 | include $(CLEAR_VARS) 35 | LOCAL_MODULE := creator_reader_lua 36 | LOCAL_MODULE_FILENAME := libcreatorreaderlua 37 | LOCAL_ARM_MODE := arm 38 | LOCAL_SRC_FILES := $(cpp_src) \ 39 | lua-bindings/creator_reader_bindings.cpp \ 40 | lua-bindings/reader/lua_creator_reader_auto.cpp \ 41 | lua-bindings/reader/lua_creator_reader_manual.cpp \ 42 | lua-bindings/dragonbones/lua_dragonbones_manual.cpp \ 43 | lua-bindings/dragonbones/lua_dragonbones_auto.cpp 44 | 45 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/. 46 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/. \ 47 | $(LOCAL_PATH)/collider \ 48 | $(LOCAL_PATH)/animation \ 49 | $(LOCAL_PATH)/dragonbones/cocos2dx \ 50 | $(LOCAL_PATH)/dragonbones/armature \ 51 | $(LOCAL_PATH)/dragonbones/animation \ 52 | $(LOCAL_PATH)/dragonbones/events \ 53 | $(LOCAL_PATH)/dragonbones/factories \ 54 | $(LOCAL_PATH)/dragonbones/core \ 55 | $(LOCAL_PATH)/dragonbones/geom 56 | LOCAL_STATIC_LIBRARIES := cocos2d_lua_static 57 | LOCAL_STATIC_LIBRARIES += dragonbones_static 58 | include $(BUILD_STATIC_LIBRARY) 59 | 60 | $(call import-add-path, $(path)) 61 | $(call import-module, dragonbones) 62 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # reader lib for creator to cocos2d-x plugin 2 | set(LIB_NAME creator_reader) 3 | 4 | include_directories( 5 | collider 6 | animation 7 | dragonbones/cocos2dx 8 | dragonbones/armature 9 | dragonbones/animation 10 | dragonbones/events 11 | dragonbones/factories 12 | dragonbones/core 13 | dragonbones/geom 14 | ${CMAKE_CURRENT_SOURCE_DIR} 15 | ${COCOS2DX_ROOT_PATH}/cocos/editor-support 16 | ) 17 | 18 | set(READER_HEADER 19 | CreatorReader_generated.h 20 | CreatorReader.h 21 | animation/Easing.h 22 | animation/AnimateClip.h 23 | animation/Bezier.h 24 | animation/AnimationClipProperties.h 25 | animation/AnimationManager.h 26 | animation/AnimationClip.h 27 | collider/Collider.h 28 | collider/Intersection.h 29 | collider/ColliderManager.h 30 | collider/Contract.h 31 | Macros.h 32 | ui/RichtextStringVisitor.h 33 | ui/PageView.h 34 | ) 35 | 36 | set(READER_SOURCE 37 | animation/AnimateClip.cpp 38 | animation/AnimationClip.cpp 39 | animation/AnimationManager.cpp 40 | animation/Easing.cpp 41 | animation/Bezier.cpp 42 | collider/Collider.cpp 43 | collider/ColliderManager.cpp 44 | collider/Contract.cpp 45 | collider/Intersection.cpp 46 | CreatorReader.cpp 47 | ui/PageView.cpp 48 | ui/RichtextStringVisitor.cpp 49 | ) 50 | 51 | if(BUILD_LUA_LIBS) 52 | list(APPEND READER_HEADER 53 | lua-bindings/reader/lua_creator_reader_auto.hpp 54 | lua-bindings/reader/lua_creator_reader_manual.hpp 55 | lua-bindings/dragonbones/lua_dragonbones_auto.hpp 56 | lua-bindings/dragonbones/lua_dragonbones_manual.hpp 57 | lua-bindings/creator_reader_bindings.hpp 58 | ) 59 | list(APPEND READER_SOURCE 60 | lua-bindings/creator_reader_bindings.cpp 61 | lua-bindings/reader/lua_creator_reader_auto.cpp 62 | lua-bindings/reader/lua_creator_reader_manual.cpp 63 | lua-bindings/dragonbones/lua_dragonbones_manual.cpp 64 | lua-bindings/dragonbones/lua_dragonbones_auto.cpp 65 | ) 66 | endif() 67 | 68 | 69 | add_library(${LIB_NAME} ${READER_SOURCE} ${READER_HEADER}) 70 | 71 | set_target_properties(${LIB_NAME} 72 | PROPERTIES 73 | ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 74 | LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 75 | FOLDER "Internal" 76 | ) 77 | 78 | add_subdirectory(dragonbones) 79 | target_link_libraries(${LIB_NAME} dragonbones) 80 | 81 | if(XCODE OR VS) 82 | cocos_mark_code_files(${LIB_NAME}) 83 | endif() 84 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/Macros.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | #ifdef __cplusplus 27 | #define NS_CCR_BEGIN namespace creator { 28 | #define NS_CCR_END } 29 | #define USING_NS_CCR using namespace creator 30 | #else 31 | #define NS_CC_BEGIN 32 | #define NS_CC_END 33 | #define USING_NS_CC 34 | #define NS_CC 35 | #endif 36 | 37 | #if defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUG__ == 4) && (__GNUC_MINOR__ >= 4))) \ 38 | || (defined(__clang__) && (__clang_major__ >= 3)) || (_MSC_VER >= 1800) 39 | #define CREATOR_DISALLOW_COPY_ASSIGN_AND_MOVE(TypeName) \ 40 | TypeName(const TypeName &) = delete; \ 41 | TypeName& operator =(const TypeName &) = delete; \ 42 | TypeName(TypeName &&) = delete; \ 43 | TypeName& operator =(TypeName &&) = delete; 44 | #else 45 | #define CREATOR_DISALLOW_COPY_ASSIGN_AND_MOVE(TypeName) \ 46 | TypeName(const TypeName &); \ 47 | TypeName& operator =(const TypeName &); \ 48 | TypeName(TypeName &&); \ 49 | TypeName& operator =(TypeName &&); 50 | #endif 51 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/animation/AnimateClip.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | #include "cocos2d.h" 27 | #include "Macros.h" 28 | 29 | NS_CCR_BEGIN 30 | 31 | class AnimationClip; 32 | struct AnimProperties; 33 | 34 | class AnimateClip : public cocos2d::Node { 35 | public: 36 | 37 | typedef std::function AnimateEndCallback; 38 | 39 | static AnimateClip* createWithAnimationClip(cocos2d::Node* rootTarget, AnimationClip* clip); 40 | 41 | void startAnimate(); 42 | void stopAnimate(); 43 | void pauseAnimate(); 44 | void resumeAnimate(); 45 | 46 | void setCallbackForEndevent(const AnimateEndCallback &callback); 47 | 48 | virtual ~AnimateClip(); 49 | 50 | // 51 | // Overrides 52 | // 53 | virtual void update(float dt) override; 54 | 55 | private: 56 | AnimateClip(); 57 | bool initWithAnimationClip(cocos2d::Node* rootTarget, AnimationClip* clip); 58 | void doUpdate(const AnimProperties& animProperties) const; 59 | cocos2d::Node* getTarget(const std::string &path) const; 60 | float computeElapse() const; 61 | 62 | AnimationClip* _clip; 63 | 64 | // the time elapsed since the animation start 65 | float _elapsed; 66 | cocos2d::Node *_rootTarget; 67 | 68 | AnimateEndCallback _endCallback; 69 | bool _needStop; 70 | float _durationToStop; 71 | }; 72 | 73 | NS_CCR_END 74 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/animation/AnimationClip.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | #include "AnimationClip.h" 26 | 27 | USING_NS_CCR; 28 | 29 | AnimationClip* AnimationClip::create() 30 | { 31 | auto animClip = new (std::nothrow) AnimationClip; 32 | if (animClip && animClip->init()) { 33 | animClip->autorelease(); 34 | return animClip; 35 | } 36 | return nullptr; 37 | } 38 | 39 | bool AnimationClip::init() 40 | { 41 | return true; 42 | } 43 | 44 | AnimationClip::AnimationClip() 45 | : _name("") 46 | , _speed(0) 47 | , _sample(0) 48 | , _duration(0) 49 | , _wrapMode(WrapMode::Default) 50 | { 51 | } 52 | 53 | AnimationClip::~AnimationClip() 54 | { 55 | } 56 | 57 | void AnimationClip::setName(const std::string& name) 58 | { 59 | _name = name; 60 | } 61 | 62 | const std::string& AnimationClip::getName() const 63 | { 64 | return _name; 65 | } 66 | 67 | void AnimationClip::setDuration(float duration) 68 | { 69 | _duration = duration; 70 | } 71 | 72 | float AnimationClip::getDuration() const 73 | { 74 | return _duration; 75 | } 76 | 77 | void AnimationClip::setSample(float sample) 78 | { 79 | _sample = sample; 80 | } 81 | 82 | float AnimationClip::getSample() const 83 | { 84 | return _sample; 85 | } 86 | 87 | void AnimationClip::setSpeed(float speed) 88 | { 89 | _speed = speed; 90 | } 91 | 92 | float AnimationClip::getSpeed() const 93 | { 94 | return _speed; 95 | } 96 | 97 | void AnimationClip::setWrapMode(WrapMode wrapMode) 98 | { 99 | _wrapMode = wrapMode; 100 | } 101 | 102 | creator::AnimationClip::WrapMode AnimationClip::getWrapMode() const 103 | { 104 | return _wrapMode; 105 | } 106 | 107 | void AnimationClip::addAnimProperties(const AnimProperties& properties) 108 | { 109 | _animPropertiesVec.push_back(properties); 110 | } 111 | 112 | const std::vector& AnimationClip::getAnimProperties() const 113 | { 114 | return _animPropertiesVec; 115 | } 116 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/animation/AnimationClip.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | #include "cocos2d.h" 27 | 28 | #include "Macros.h" 29 | #include "AnimationClipProperties.h" 30 | 31 | NS_CCR_BEGIN 32 | 33 | class AnimationClip: public cocos2d::Ref 34 | { 35 | public: 36 | 37 | // refer to: https://github.com/cocos-creator/engine/blob/master/cocos2d/animation/types.js#L28 38 | enum class WrapMode {Default = 0, Normal = 1, Loop = 2, PingPong = 22, Reverse = 36, LoopReverse = 38, PingPongReverse = 54}; 39 | 40 | static AnimationClip* create(); 41 | virtual ~AnimationClip(); 42 | 43 | bool init(); 44 | 45 | void setName(const std::string& name); 46 | const std::string& getName() const; 47 | 48 | void setDuration(float duration); 49 | float getDuration() const; 50 | 51 | void setSample(float sample); 52 | float getSample() const; 53 | 54 | void setSpeed(float speed); 55 | float getSpeed() const; 56 | 57 | void setWrapMode(WrapMode wrapMode); 58 | WrapMode getWrapMode() const; 59 | 60 | void addAnimProperties(const AnimProperties& properties); 61 | const std::vector& getAnimProperties() const; 62 | 63 | private: 64 | AnimationClip(); 65 | 66 | std::string _name; 67 | float _duration; 68 | float _sample; 69 | float _speed; 70 | WrapMode _wrapMode; 71 | std::vector _animPropertiesVec; 72 | }; 73 | 74 | NS_CCR_END 75 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/animation/AnimationManager.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | 27 | #include 28 | #include 29 | 30 | #include "Macros.h" 31 | #include "AnimationClip.h" 32 | 33 | NS_CCR_BEGIN 34 | 35 | class AnimateClip; 36 | 37 | struct AnimationInfo 38 | { 39 | AnimationClip* defaultClip; 40 | cocos2d::Vector clips; 41 | bool playOnLoad; 42 | cocos2d::Node* target; // will retain the target 43 | }; 44 | 45 | class AnimationManager : public cocos2d::Node 46 | { 47 | public: 48 | void playAnimationClip(cocos2d::Node *target, const std::string &animationClipName); 49 | // if AnimationClip is stopped, can not run it again. 50 | void stopAnimationClip(cocos2d::Node *target, const std::string &animationClipName); 51 | void pauseAnimationClip(cocos2d::Node *target, const std::string &animationClipName); 52 | void resumeAnimationClip(cocos2d::Node *target, const std::string &animationClipName); 53 | // if a "Play On Load" animation is a loop animation, please stop it manually. 54 | void stopAnimationClipsRunByPlayOnLoad(); 55 | private: 56 | friend class CreatorReader; 57 | 58 | AnimationManager(); 59 | ~AnimationManager(); 60 | 61 | // functions invoked by CreatorReader only 62 | void addAnimation(const AnimationInfo& animationInfo); 63 | void playOnLoad(); 64 | 65 | void runAnimationClip(cocos2d::Node *target, AnimationClip* animationClip); 66 | // AnimateClip will be released 67 | void removeAnimateClip(cocos2d::Node *target, const std::string &animationClipName); 68 | AnimateClip* getAnimateClip(cocos2d::Node *target, const std::string &animationClipName) const; 69 | 70 | std::vector _animations; 71 | std::vector> _cachedAnimates; 72 | 73 | CREATOR_DISALLOW_COPY_ASSIGN_AND_MOVE(AnimationManager); 74 | }; 75 | 76 | NS_CC_END 77 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/animation/Bezier.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | #include "Macros.h" 27 | 28 | #include 29 | 30 | NS_CCR_BEGIN 31 | 32 | namespace Bazier 33 | { 34 | float computeBezier(const std::vector& controlPoints, float ratio); 35 | } 36 | 37 | NS_CCR_END 38 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/animation/Easing.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | #include "Macros.h" 27 | 28 | #include 29 | #include 30 | 31 | NS_CCR_BEGIN 32 | 33 | namespace Easing 34 | { 35 | std::function getFunction(const std::string& type); 36 | } 37 | 38 | NS_CCR_END 39 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/collider/ColliderManager.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | #include "2d/CCDrawNode.h" 30 | 31 | #include "Macros.h" 32 | #include "Contract.h" 33 | #include "Collider.h" 34 | 35 | NS_CCR_BEGIN 36 | 37 | class ColliderManager : public cocos2d::Node 38 | { 39 | public: 40 | typedef std::function CollistionCallback; 41 | 42 | void update(float dt); 43 | void removeCollider(Collider* collider); 44 | 45 | void enableDebugDraw(bool enabled); 46 | bool isDebugDrawEnabled() const; 47 | 48 | void enableAABBDebugDraw(bool value); 49 | bool isAABBDebugDrawEnabled() const; 50 | 51 | 52 | /** Register/unregister a callback. `key` is used to unregister because can not compare std::function<>. 53 | */ 54 | void registerCollitionCallback(CollistionCallback callback, const std::string& key); 55 | void unregisterCollisionCallback(const std::string& key); 56 | 57 | private: 58 | friend class CreatorReader; 59 | 60 | ColliderManager(); 61 | ~ColliderManager(); 62 | 63 | // invoked by CreatorReader 64 | void start(); 65 | void setCollistionMatrix(const std::vector>& collistionMatrix); 66 | void addCollider(Collider* collider); 67 | 68 | bool shouldColider(Collider* collider1, Collider* collider2) const; 69 | void checkColliders(); 70 | void drawColliders() const; 71 | 72 | cocos2d::Vector _contracts; 73 | cocos2d::Vector _colliders; 74 | std::vector> _collisionMatrix; 75 | bool _debugDrawEnabled; 76 | bool _AABBDebugDrawEnabled; 77 | 78 | cocos2d::DrawNode* _debugDrawNode; 79 | 80 | std::unordered_map _collisionCallbacks; 81 | 82 | CREATOR_DISALLOW_COPY_ASSIGN_AND_MOVE(ColliderManager); 83 | }; 84 | 85 | NS_CCR_END 86 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/collider/Contract.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | #include "Macros.h" 27 | #include "Collider.h" 28 | 29 | NS_CCR_BEGIN 30 | 31 | class Contract : public cocos2d::Ref 32 | { 33 | public: 34 | enum class CollisionType 35 | { 36 | NONE, 37 | ENTER, 38 | STAY, 39 | EXIT 40 | }; 41 | 42 | Collider* getCollider1() const; 43 | Collider* getCollider2() const; 44 | 45 | private: 46 | friend class ColliderManager; 47 | 48 | Contract(Collider* collider1, Collider* collider2); 49 | ~Contract(); 50 | CollisionType updateState(); 51 | bool test() const; 52 | 53 | static bool isBoxCollider(Collider* collider); 54 | static bool isPolygonCollider(Collider* collider); 55 | static bool isCircleCollider(Collider* collider); 56 | 57 | Collider* _collider1; 58 | Collider* _collider2; 59 | bool _touching; 60 | bool _isPolygonPolygon; 61 | bool _isCircleCircle; 62 | bool _isPolygonCircle; 63 | 64 | CREATOR_DISALLOW_COPY_ASSIGN_AND_MOVE(Contract); 65 | }; 66 | 67 | NS_CCR_END 68 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/collider/Intersection.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | #include 27 | #include "math/Vec2.h" 28 | #include "Macros.h" 29 | 30 | NS_CCR_BEGIN 31 | 32 | class Intersection 33 | { 34 | public: 35 | /** Test whether two polygons interset. 36 | * @param p1 points of first polygon 37 | * @param p2 points of second polygon 38 | * @return True if two polygon intersect 39 | * False else 40 | */ 41 | static bool polygonPolygon(const std::vector& polygon1, const std::vector& polygon2); 42 | /** Test whether two circles intersect. 43 | * @param pos1 first circle's position 44 | * @param r1 first circle's radius 45 | * @param pos2 second circle's position 46 | * @param r2 second circle's radius 47 | */ 48 | static bool circleCircle(const cocos2d::Vec2& pos1, float r1, const cocos2d::Vec2& pos2, float r2); 49 | /** Test whether a polygon intersects with a circle. 50 | * @param p points of the polygon 51 | * @param pos the circle's position 52 | * @param r the circle's radius 53 | */ 54 | static bool polygonCircle(const std::vector& polygon, const cocos2d::Vec2& pos, float r); 55 | private: 56 | static bool linePolygon(const cocos2d::Vec2& A, const cocos2d::Vec2& B, const std::vector& polygon); 57 | static bool pointInPolygon(const cocos2d::Vec2& pos, const std::vector& p); 58 | static float pointLineDistance(const cocos2d::Vec2& point, const cocos2d::Vec2& start, const cocos2d::Vec2& end, bool isSegment); 59 | }; 60 | 61 | NS_CCR_END 62 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := dragonbones_static 6 | 7 | LOCAL_MODULE_FILENAME := libdragonbones 8 | 9 | 10 | LOCAL_SRC_FILES := animation/Animation.cpp \ 11 | animation/AnimationState.cpp \ 12 | animation/TimelineState.cpp \ 13 | animation/WorldClock.cpp \ 14 | armature/Armature.cpp \ 15 | armature/Bone.cpp \ 16 | armature/Slot.cpp \ 17 | core/BaseObject.cpp \ 18 | events/EventObject.cpp \ 19 | factories/BaseFactory.cpp \ 20 | model/AnimationData.cpp \ 21 | model/ArmatureData.cpp \ 22 | model/DragonBonesData.cpp \ 23 | model/FrameData.cpp \ 24 | model/TimelineData.cpp \ 25 | parsers/DataParser.cpp \ 26 | parsers/JSONDataParser.cpp \ 27 | textures/TextureData.cpp \ 28 | cocos2dx/CCArmatureDisplay.cpp \ 29 | cocos2dx/CCFactory.cpp \ 30 | cocos2dx/CCSlot.cpp \ 31 | cocos2dx/CCTextureData.cpp 32 | 33 | 34 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. 35 | 36 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. 37 | 38 | LOCAL_STATIC_LIBRARIES := cocos2dx_internal_static 39 | 40 | LOCAL_CFLAGS += -Wno-psabi 41 | LOCAL_EXPORT_CFLAGS += -Wno-psabi 42 | 43 | include $(BUILD_STATIC_LIBRARY) 44 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(LIB_NAME dragonbones) 2 | 3 | include_directories( 4 | ${CMAKE_CURRENT_SOURCE_DIR}/.. 5 | ) 6 | 7 | set(DRAGONBONES_HEADER 8 | DragonBonesHeaders.h 9 | textures/TextureData.h 10 | parsers/JSONDataParser.h 11 | parsers/DataParser.h 12 | core/BaseObject.h 13 | core/DragonBones.h 14 | armature/TransformObject.h 15 | armature/Bone.h 16 | armature/Armature.h 17 | armature/Slot.h 18 | armature/IArmatureDisplay.h 19 | animation/Animation.h 20 | animation/IAnimateble.h 21 | animation/BaseTimelineState.h 22 | animation/WorldClock.h 23 | animation/TimelineState.h 24 | animation/AnimationState.h 25 | cocos2dx/CCArmatureDisplay.h 26 | cocos2dx/CCTextureData.h 27 | cocos2dx/CCDragonBonesHeaders.h 28 | cocos2dx/CCFactory.h 29 | cocos2dx/CCSlot.h 30 | geom/Point.h 31 | geom/Matrix.h 32 | geom/Transform.h 33 | geom/Rectangle.h 34 | geom/ColorTransform.h 35 | factories/BaseFactory.h 36 | model/ArmatureData.h 37 | model/AnimationData.h 38 | model/TimelineData.h 39 | model/FrameData.h 40 | model/DragonBonesData.h 41 | events/EventObject.h 42 | ) 43 | 44 | set(DRAGONBONES_SOURCE 45 | animation/Animation.cpp 46 | animation/AnimationState.cpp 47 | animation/TimelineState.cpp 48 | animation/WorldClock.cpp 49 | armature/Armature.cpp 50 | armature/Bone.cpp 51 | armature/Slot.cpp 52 | core/BaseObject.cpp 53 | events/EventObject.cpp 54 | factories/BaseFactory.cpp 55 | model/AnimationData.cpp 56 | model/ArmatureData.cpp 57 | model/DragonBonesData.cpp 58 | model/FrameData.cpp 59 | model/TimelineData.cpp 60 | parsers/DataParser.cpp 61 | parsers/JSONDataParser.cpp 62 | textures/TextureData.cpp 63 | cocos2dx/CCArmatureDisplay.cpp 64 | cocos2dx/CCFactory.cpp 65 | cocos2dx/CCSlot.cpp 66 | cocos2dx/CCTextureData.cpp 67 | ) 68 | 69 | add_library(${LIB_NAME} ${DRAGONBONES_SOURCE} ${DRAGONBONES_HEADER}) 70 | 71 | set_target_properties(${LIB_NAME} 72 | PROPERTIES 73 | ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 74 | LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" 75 | FOLDER "Internal" 76 | ) 77 | 78 | if(XCODE OR VS) 79 | cocos_mark_code_files(${LIB_NAME}) 80 | endif() 81 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/DragonBonesHeaders.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_HEADERS_H 2 | #define DRAGONBONES_HEADERS_H 3 | 4 | // core 5 | #include "core/DragonBones.h" 6 | #include "core/BaseObject.h" 7 | 8 | // geom 9 | #include "geom/ColorTransform.h" 10 | #include "geom/Matrix.h" 11 | #include "geom/Point.h" 12 | #include "geom/Rectangle.h" 13 | #include "geom/Transform.h" 14 | 15 | // textures 16 | #include "textures/TextureData.h" 17 | 18 | // model 19 | #include "model/FrameData.h" 20 | #include "model/DragonBonesData.h" 21 | #include "model/ArmatureData.h" 22 | #include "model/AnimationData.h" 23 | #include "model/TimelineData.h" 24 | 25 | // parsers 26 | #include "parsers/DataParser.h" 27 | #include "parsers/JSONDataParser.h" 28 | 29 | // factories 30 | #include "factories/BaseFactory.h" 31 | 32 | // armature 33 | #include "armature/IArmatureDisplay.h" 34 | #include "armature/Armature.h" 35 | #include "armature/TransformObject.h" 36 | #include "armature/Bone.h" 37 | #include "armature/Slot.h" 38 | 39 | // animation 40 | #include "animation/IAnimateble.h" 41 | #include "animation/WorldClock.h" 42 | #include "animation/Animation.h" 43 | #include "animation/AnimationState.h" 44 | #include "animation/BaseTimelineState.h" 45 | #include "animation/TimelineState.h" 46 | 47 | // events 48 | #include "events/EventObject.h" 49 | 50 | #endif // DRAGONBONES_HEADERS_H 51 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/animation/IAnimateble.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_ANIMATEBLE_H 2 | #define DRAGONBONES_ANIMATEBLE_H 3 | 4 | #include "../core/DragonBones.h" 5 | 6 | DRAGONBONES_NAMESPACE_BEGIN 7 | 8 | class IAnimateble 9 | { 10 | public: 11 | IAnimateble() {} 12 | virtual ~IAnimateble() {} 13 | 14 | virtual void advanceTime(float passedTime) = 0; 15 | }; 16 | 17 | DRAGONBONES_NAMESPACE_END 18 | #endif // DRAGONBONES_ANIMATEBLE_H -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/animation/WorldClock.cpp: -------------------------------------------------------------------------------- 1 | #include "WorldClock.h" 2 | 3 | DRAGONBONES_NAMESPACE_BEGIN 4 | 5 | WorldClock WorldClock::clock; 6 | 7 | WorldClock::WorldClock(): 8 | time(0.f), 9 | timeScale(1.f), 10 | _animatebles() 11 | { 12 | } 13 | WorldClock::~WorldClock() 14 | { 15 | clear(); 16 | } 17 | 18 | void WorldClock::advanceTime(float passedTime) 19 | { 20 | if (passedTime < 0 || passedTime != passedTime) 21 | { 22 | passedTime = 0; 23 | } 24 | 25 | passedTime *= timeScale; 26 | 27 | if (passedTime < 0) 28 | { 29 | time -= passedTime; 30 | } 31 | else 32 | { 33 | time += passedTime; 34 | } 35 | 36 | if (passedTime) 37 | { 38 | std::size_t i = 0, r = 0, l = _animatebles.size(); 39 | 40 | for (; i < l; ++i) 41 | { 42 | const auto animateble = _animatebles[i]; 43 | if (animateble) 44 | { 45 | if (r > 0) 46 | { 47 | _animatebles[i - r] = animateble; 48 | _animatebles[i] = nullptr; 49 | } 50 | 51 | animateble->advanceTime(passedTime); 52 | } 53 | else 54 | { 55 | r++; 56 | } 57 | } 58 | 59 | if (r > 0) 60 | { 61 | l = _animatebles.size(); 62 | 63 | for (; i < l; ++i) 64 | { 65 | const auto animateble = _animatebles[i]; 66 | if (animateble) 67 | { 68 | _animatebles[i - r] = animateble; 69 | } 70 | else 71 | { 72 | r++; 73 | } 74 | } 75 | 76 | _animatebles.resize(l - r); 77 | } 78 | } 79 | } 80 | 81 | bool WorldClock::contains(const IAnimateble* value) const 82 | { 83 | return std::find(_animatebles.cbegin(), _animatebles.cend(), value) != _animatebles.cend(); 84 | } 85 | 86 | void WorldClock::add(IAnimateble* value) 87 | { 88 | if (std::find(_animatebles.begin(), _animatebles.end(), value) == _animatebles.end()) 89 | { 90 | _animatebles.push_back(value); 91 | } 92 | } 93 | 94 | void WorldClock::remove(IAnimateble* value) 95 | { 96 | const auto iterator = std::find(_animatebles.begin(), _animatebles.end(), value); 97 | if (iterator != _animatebles.end()) 98 | { 99 | *iterator = nullptr; 100 | } 101 | } 102 | 103 | void WorldClock::clear() 104 | { 105 | for (auto& animateble : _animatebles) 106 | { 107 | animateble = nullptr; 108 | } 109 | } 110 | 111 | DRAGONBONES_NAMESPACE_END 112 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/animation/WorldClock.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_WORLD_CLOCK_H 2 | #define DRAGONBONES_WORLD_CLOCK_H 3 | 4 | #include "../core/DragonBones.h" 5 | #include "IAnimateble.h" 6 | 7 | DRAGONBONES_NAMESPACE_BEGIN 8 | class WorldClock final : public IAnimateble 9 | { 10 | public: 11 | static WorldClock clock; 12 | 13 | public: 14 | float time; 15 | float timeScale; 16 | 17 | private: 18 | std::vector _animatebles; 19 | 20 | public: 21 | WorldClock(); 22 | ~WorldClock(); 23 | 24 | virtual void advanceTime(float passedTime) override; 25 | bool contains(const IAnimateble* value) const; 26 | void add(IAnimateble* value); 27 | void remove(IAnimateble* value); 28 | void clear(); 29 | 30 | private: 31 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(WorldClock); 32 | }; 33 | 34 | DRAGONBONES_NAMESPACE_END 35 | #endif // DRAGONBONES_WORLD_CLOCK_H -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/armature/Bone.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_BONE_H 2 | #define DRAGONBONES_BONE_H 3 | 4 | #include "TransformObject.h" 5 | 6 | DRAGONBONES_NAMESPACE_BEGIN 7 | 8 | class Bone final : public TransformObject 9 | { 10 | BIND_CLASS_TYPE(Bone); 11 | 12 | public: 13 | /** @private */ 14 | enum class BoneTransformDirty 15 | { 16 | None = 0, 17 | Self = 1, 18 | All = 2 19 | }; 20 | 21 | bool inheritTranslation; 22 | bool inheritRotation; 23 | bool inheritScale; 24 | bool ikBendPositive; 25 | float ikWeight; 26 | float length; 27 | 28 | public: 29 | /** @private */ 30 | BoneTransformDirty _transformDirty; 31 | /** @private */ 32 | int _blendIndex; 33 | /** @private */ 34 | std::vector* _cacheFrames; 35 | /** @private */ 36 | Transform _animationPose; 37 | 38 | private: 39 | bool _visible; 40 | unsigned _ikChain; 41 | int _ikChainIndex; 42 | Bone* _ik; 43 | mutable std::vector _bones; 44 | mutable std::vector _slots; 45 | 46 | public: 47 | Bone(); 48 | ~Bone(); 49 | 50 | private: 51 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(Bone); 52 | 53 | void _updateGlobalTransformMatrix(); 54 | void _computeIKA(); 55 | void _computeIKB(); 56 | 57 | protected: 58 | void _onClear() override; 59 | 60 | public: 61 | /** @private */ 62 | virtual void _setArmature(Armature* value) override; 63 | /** @private */ 64 | void _setIK(Bone* value, unsigned chain, int chainIndex); 65 | /** @private */ 66 | void _update(int cacheFrameIndex); 67 | 68 | public: 69 | bool contains(const TransformObject* child) const; 70 | void setVisible(bool value); 71 | const std::vector& getBones() const; 72 | const std::vector& getSlots() const; 73 | 74 | inline void invalidUpdate() 75 | { 76 | _transformDirty = BoneTransformDirty::All; 77 | } 78 | 79 | inline unsigned getIKChain() const 80 | { 81 | return _ikChain; 82 | } 83 | 84 | inline unsigned getIKChainIndex() const 85 | { 86 | return _ikChainIndex; 87 | } 88 | 89 | inline Bone* getIK() const 90 | { 91 | return _ik; 92 | } 93 | 94 | inline bool getVisible() const 95 | { 96 | return _visible; 97 | } 98 | }; 99 | 100 | DRAGONBONES_NAMESPACE_END 101 | #endif // DRAGONBONES_BONE_H 102 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/armature/IArmatureDisplay.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_ARMATURE_DISPLAY_CONTAINER_H 2 | #define DRAGONBONES_ARMATURE_DISPLAY_CONTAINER_H 3 | 4 | #include "../core/DragonBones.h" 5 | #include "../events/EventObject.h" 6 | 7 | DRAGONBONES_NAMESPACE_BEGIN 8 | 9 | class Armature; 10 | class Animation; 11 | 12 | class IArmatureDisplay : public IEventDispatcher 13 | { 14 | protected: 15 | IArmatureDisplay() {}; 16 | virtual ~IArmatureDisplay() {}; 17 | 18 | public: 19 | virtual void dispose() = 0; 20 | virtual void advanceTimeBySelf(bool on) = 0; 21 | virtual Armature* getArmature() const = 0; 22 | virtual Animation& getAnimation() const = 0; 23 | }; 24 | 25 | DRAGONBONES_NAMESPACE_END 26 | #endif // DRAGONBONES_ARMATURE_DISPLAY_CONTAINER_H -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/armature/TransformObject.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_TRANSFORM_OBJECT_H 2 | #define DRAGONBONES_TRANSFORM_OBJECT_H 3 | 4 | #include "../core/BaseObject.h" 5 | #include "../geom/Matrix.h" 6 | #include "../geom/Transform.h" 7 | 8 | DRAGONBONES_NAMESPACE_BEGIN 9 | 10 | class Armature; 11 | class Bone; 12 | class Slot; 13 | 14 | class TransformObject : public BaseObject // ABSTRACT 15 | { 16 | public: 17 | void* userData; 18 | std::string name; 19 | Matrix* globalTransformMatrix; 20 | Transform global; 21 | Transform origin; 22 | Transform offset; 23 | 24 | public: 25 | /** @private */ 26 | Armature* _armature; 27 | /** @private */ 28 | Bone* _parent; 29 | 30 | protected: 31 | Matrix _globalTransformMatrix; 32 | 33 | public: 34 | /** @private */ 35 | TransformObject() {} 36 | /** @private */ 37 | virtual ~TransformObject() {}; 38 | 39 | protected: 40 | void _onClear() override 41 | { 42 | userData = nullptr; 43 | name.clear(); 44 | globalTransformMatrix = &_globalTransformMatrix; 45 | global.identity(); 46 | origin.identity(); 47 | offset.identity(); 48 | 49 | _armature = nullptr; 50 | _parent = nullptr; 51 | _globalTransformMatrix.identity(); 52 | } 53 | 54 | public: 55 | /** @private */ 56 | virtual void _setArmature(Armature* value) 57 | { 58 | _armature = value; 59 | } 60 | 61 | /** @private */ 62 | virtual void _setParent(Bone* value) 63 | { 64 | _parent = value; 65 | } 66 | 67 | public: 68 | inline Armature* getArmature() const 69 | { 70 | return _armature; 71 | } 72 | 73 | inline Bone* getParent() const 74 | { 75 | return _parent; 76 | } 77 | }; 78 | 79 | DRAGONBONES_NAMESPACE_END 80 | #endif // DRAGONBONES_TRANSFORM_OBJECT_H 81 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/cocos2dx/CCArmatureDisplay.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H 2 | #define DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H 3 | 4 | #include "dragonbones/DragonBonesHeaders.h" 5 | #include "cocos2d.h" 6 | 7 | DRAGONBONES_NAMESPACE_BEGIN 8 | 9 | class CCArmatureDisplay : public cocos2d::Node, public IArmatureDisplay 10 | { 11 | public: 12 | /** @private */ 13 | static CCArmatureDisplay* create(); 14 | 15 | public: 16 | /** @private */ 17 | Armature* _armature; 18 | 19 | protected: 20 | cocos2d::EventDispatcher* _dispatcher; 21 | 22 | protected: 23 | CCArmatureDisplay(); 24 | virtual ~CCArmatureDisplay(); 25 | 26 | private: 27 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(CCArmatureDisplay); 28 | 29 | public: 30 | /** @private */ 31 | virtual void _onClear() override; 32 | /** @private */ 33 | virtual void _dispatchEvent(EventObject* value) override; 34 | /** @private */ 35 | virtual void dispose() override; 36 | /** @private */ 37 | virtual void update(float passedTime) override; 38 | 39 | public: 40 | virtual void advanceTimeBySelf(bool on) override; 41 | 42 | void addEvent(const std::string& type, const std::function& callback); 43 | void removeEvent(const std::string& type); 44 | 45 | inline bool hasEvent(const std::string& type) const override 46 | { 47 | return _eventCallback || _dispatcher->isEnabled(); 48 | } 49 | 50 | inline Armature* getArmature() const override 51 | { 52 | return _armature; 53 | } 54 | 55 | virtual Animation& getAnimation() const override 56 | { 57 | return _armature->getAnimation(); 58 | } 59 | 60 | CC_CONSTRUCTOR_ACCESS: 61 | // methods added for js bindings 62 | void setEventCallback(const std::function& callback) { 63 | this->_eventCallback = callback; 64 | } 65 | inline bool hasEventCallback() { return this->_eventCallback ? true : false; } 66 | inline void clearEventCallback() { this->_eventCallback = nullptr; } 67 | 68 | private: 69 | // added for js bindings 70 | std::function _eventCallback; 71 | }; 72 | 73 | /** @private */ 74 | class DBCCSprite : public cocos2d::Sprite 75 | { 76 | public: 77 | /** @private */ 78 | static DBCCSprite* create(); 79 | 80 | protected: 81 | DBCCSprite(); 82 | virtual ~DBCCSprite(); 83 | 84 | private: 85 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(DBCCSprite); 86 | 87 | /** 88 | * Modify for polyInfo rect 89 | */ 90 | bool _checkVisibility(const cocos2d::Mat4& transform, const cocos2d::Size& size, const cocos2d::Rect& rect); 91 | 92 | cocos2d::Vec2 projectGL(const cocos2d::Vec3& src) const; 93 | 94 | public: 95 | /** 96 | * Modify for polyInfo rect 97 | */ 98 | virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags) override; 99 | /** 100 | * Modify for cocos2dx 3.7, 3.8, 3.9 101 | */ 102 | cocos2d::PolygonInfo& getPolygonInfoModify(); 103 | }; 104 | 105 | DRAGONBONES_NAMESPACE_END 106 | #endif // DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H 107 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/cocos2dx/CCDragonBonesHeaders.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_CC_HEADERS_H 2 | #define DRAGONBONES_CC_HEADERS_H 3 | 4 | #include "dragonbones/cocos2dx/CCTextureData.h" 5 | #include "dragonbones/cocos2dx/CCArmatureDisplay.h" 6 | #include "dragonbones/cocos2dx/CCSlot.h" 7 | #include "dragonbones/cocos2dx/CCFactory.h" 8 | 9 | #endif // DRAGONBONES_CC_HEADERS_H 10 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/cocos2dx/CCFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_CC_FACTORY_H 2 | #define DRAGONBONES_CC_FACTORY_H 3 | 4 | #include "dragonbones/DragonBonesHeaders.h" 5 | #include "cocos2d.h" 6 | #include "CCArmatureDisplay.h" 7 | 8 | DRAGONBONES_NAMESPACE_BEGIN 9 | 10 | class CCFactory : public BaseFactory 11 | { 12 | public: 13 | static CCFactory* getInstance(); 14 | static void destroyInstance(); 15 | 16 | private: 17 | static CCFactory *s_factory; 18 | 19 | public: 20 | CCFactory(); 21 | ~CCFactory(); 22 | 23 | private: 24 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(CCFactory); 25 | 26 | protected: 27 | virtual TextureAtlasData* _generateTextureAtlasData(TextureAtlasData* textureAtlasData, void* textureAtlas) const override; 28 | virtual Armature* _generateArmature(const BuildArmaturePackage& dataPackage) const override; 29 | virtual Slot* _generateSlot(const BuildArmaturePackage& dataPackage, const SlotDisplayDataSet& slotDisplayDataSet) const override; 30 | 31 | public: 32 | virtual DragonBonesData* loadDragonBonesData(const std::string& filePath, const std::string& dragonBonesName = ""); 33 | virtual TextureAtlasData* loadTextureAtlasData(const std::string& filePath, const std::string& dragonBonesName = "", float scale = 0.f); 34 | virtual TextureAtlasData* parseTextureAtlasData(const std::string& atlasData, const std::string& texturePath, const std::string& dragonBonesName = "", float scale = 0.f); 35 | virtual CCArmatureDisplay* buildArmatureDisplay(const std::string& armatureName, const std::string& dragonBonesName = "", const std::string& skinName = "") const; 36 | virtual cocos2d::Sprite* getTextureDisplay(const std::string& textureName, const std::string& dragonBonesName = "") const; 37 | virtual CCArmatureDisplay* getSoundEventManater() const; 38 | 39 | private: 40 | void _initTextureAtlasData(TextureAtlasData* atlasData); 41 | }; 42 | 43 | DRAGONBONES_NAMESPACE_END 44 | #endif // DRAGONBONES_CC_FACTORY_H 45 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/cocos2dx/CCSlot.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_CC_SLOT_H 2 | #define DRAGONBONES_CC_SLOT_H 3 | 4 | #include "dragonbones/DragonBonesHeaders.h" 5 | #include "cocos2d.h" 6 | 7 | DRAGONBONES_NAMESPACE_BEGIN 8 | class CCSlot : public Slot 9 | { 10 | BIND_CLASS_TYPE(CCSlot); 11 | 12 | private: 13 | cocos2d::Node* _renderDisplay; 14 | 15 | public: 16 | CCSlot(); 17 | ~CCSlot(); 18 | 19 | virtual void _onClear() override; 20 | 21 | private: 22 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(CCSlot); 23 | 24 | protected: 25 | virtual void _initDisplay(void* value) override; 26 | virtual void _disposeDisplay(void* value) override; 27 | virtual void _onUpdateDisplay() override; 28 | virtual void _addDisplay() override; 29 | virtual void _replaceDisplay(void* value, bool isArmatureDisplayContainer) override; 30 | virtual void _removeDisplay() override; 31 | virtual void _updateColor() override; 32 | virtual void _updateFilters() override; 33 | virtual void _updateFrame() override; 34 | virtual void _updateMesh() override; 35 | virtual void _updateTransform() override; 36 | 37 | public: 38 | virtual void _updateVisible() override; 39 | virtual void _updateBlendMode() override; 40 | }; 41 | 42 | DRAGONBONES_NAMESPACE_END 43 | #endif // DRAGONBONES_CC_SLOT_H 44 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/cocos2dx/CCTextureData.cpp: -------------------------------------------------------------------------------- 1 | #include "CCTextureData.h" 2 | 3 | DRAGONBONES_NAMESPACE_BEGIN 4 | 5 | CCTextureData::CCTextureData() : 6 | texture(nullptr) 7 | { 8 | _onClear(); 9 | } 10 | CCTextureData::~CCTextureData() 11 | { 12 | _onClear(); 13 | } 14 | 15 | void CCTextureData::_onClear() 16 | { 17 | TextureData::_onClear(); 18 | 19 | if (texture) 20 | { 21 | texture->release(); 22 | texture = nullptr; 23 | } 24 | } 25 | 26 | CCTextureAtlasData::CCTextureAtlasData() : 27 | texture(nullptr) 28 | { 29 | _onClear(); 30 | } 31 | CCTextureAtlasData::~CCTextureAtlasData() 32 | { 33 | _onClear(); 34 | } 35 | 36 | void CCTextureAtlasData::_onClear() 37 | { 38 | TextureAtlasData::_onClear(); 39 | 40 | if (texture) 41 | { 42 | //texture->release(); 43 | texture = nullptr; 44 | } 45 | } 46 | 47 | TextureData * CCTextureAtlasData::generateTexture() const 48 | { 49 | return BaseObject::borrowObject(); 50 | } 51 | 52 | DRAGONBONES_NAMESPACE_END -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/cocos2dx/CCTextureData.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_CC_TEXTURE_DATA_H 2 | #define DRAGONBONES_CC_TEXTURE_DATA_H 3 | 4 | #include "dragonbones/DragonBonesHeaders.h" 5 | #include "cocos2d.h" 6 | 7 | DRAGONBONES_NAMESPACE_BEGIN 8 | class CCTextureData final : public TextureData 9 | { 10 | BIND_CLASS_TYPE(CCTextureData); 11 | 12 | public: 13 | cocos2d::SpriteFrame* texture; 14 | 15 | CCTextureData(); 16 | ~CCTextureData(); 17 | 18 | private: 19 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(CCTextureData); 20 | 21 | protected: 22 | virtual void _onClear() override; 23 | }; 24 | 25 | class CCTextureAtlasData final : public TextureAtlasData 26 | { 27 | BIND_CLASS_TYPE(CCTextureAtlasData); 28 | 29 | public: 30 | cocos2d::Texture2D* texture; 31 | 32 | CCTextureAtlasData(); 33 | ~CCTextureAtlasData(); 34 | 35 | private: 36 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(CCTextureAtlasData); 37 | 38 | protected: 39 | virtual void _onClear() override; 40 | 41 | public: 42 | virtual TextureData* generateTexture() const override; 43 | }; 44 | 45 | DRAGONBONES_NAMESPACE_END 46 | #endif // DRAGONBONES_CC_TEXTURE_DATA_H 47 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/core/BaseObject.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_BASE_OBJECT_H 2 | #define DRAGONBONES_BASE_OBJECT_H 3 | 4 | #include "DragonBones.h" 5 | 6 | #define BIND_CLASS_TYPE(CLASS) \ 7 | public:\ 8 | static std::size_t getTypeIndex()\ 9 | {\ 10 | static const auto typeIndex = typeid(CLASS).hash_code();\ 11 | return typeIndex;\ 12 | }\ 13 | virtual std::size_t getClassTypeIndex() const override\ 14 | {\ 15 | return CLASS::getTypeIndex();\ 16 | }\ 17 | 18 | DRAGONBONES_NAMESPACE_BEGIN 19 | 20 | class BaseObject 21 | { 22 | public: 23 | typedef std::function RecycleOrDestroyCallback; 24 | private: 25 | static std::size_t _hashCode; 26 | static std::size_t _defaultMaxCount; 27 | static std::unordered_map _maxCountMap; 28 | static std::unordered_map> _poolsMap; 29 | 30 | static RecycleOrDestroyCallback _recycleOrDestroyCallback; 31 | static void _returnObject(BaseObject *object); 32 | public: 33 | 34 | static void setObjectRecycleOrDestroyCallback(const RecycleOrDestroyCallback& cb); 35 | static void setMaxCount(std::size_t classTypeIndex, std::size_t maxCount); 36 | static void clearPool(std::size_t classTypeIndex); 37 | 38 | template 39 | static T* borrowObject() 40 | { 41 | const auto classTypeIndex = T::getTypeIndex(); 42 | const auto iterator = _poolsMap.find(classTypeIndex); 43 | if (iterator != _poolsMap.end()) 44 | { 45 | auto& pool = iterator->second; 46 | if (!pool.empty()) 47 | { 48 | const auto object = dynamic_cast(pool.back()); 49 | pool.pop_back(); 50 | 51 | return object; 52 | } 53 | } 54 | 55 | return new (std::nothrow) T(); 56 | } 57 | 58 | public: 59 | const std::size_t hashCode; 60 | 61 | public: 62 | /** @private */ 63 | BaseObject(); 64 | /** @private */ 65 | virtual ~BaseObject(); 66 | 67 | protected: 68 | virtual void _onClear() = 0; 69 | 70 | public: 71 | /** @private */ 72 | virtual std::size_t getClassTypeIndex() const = 0; 73 | 74 | void returnToPool(); 75 | }; 76 | 77 | DRAGONBONES_NAMESPACE_END 78 | #endif // DRAGONBONES_BASE_OBJECT_H 79 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/core/DragonBones.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_H 2 | #define DRAGONBONES_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | // dragonBones assert 16 | #ifndef DRAGONBONES_ASSERT 17 | #define DRAGONBONES_ASSERT(cond, msg) do { \ 18 | assert(cond); \ 19 | } while (0) 20 | #endif 21 | 22 | // namespace dragonBones {} 23 | #define DRAGONBONES_NAMESPACE_BEGIN namespace dragonBones { 24 | #define DRAGONBONES_NAMESPACE_END } 25 | 26 | // using dragonBones namespace 27 | #define DRAGONBONES_USING_NAME_SPACE using namespace dragonBones 28 | 29 | /** 30 | * A macro to disallow the copy constructor and operator= functions 31 | * This should be used in the private: declarations for a class 32 | */ 33 | #define DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(CLASS)\ 34 | CLASS(const CLASS&);\ 35 | void operator=(const CLASS&)\ 36 | 37 | DRAGONBONES_NAMESPACE_BEGIN 38 | 39 | enum class TextureFormat 40 | { 41 | DEFAULT, 42 | RGBA8888, 43 | BGRA8888, 44 | RGBA4444, 45 | RGB888, 46 | RGB565, 47 | RGBA5551 48 | }; 49 | 50 | enum class DisplayType 51 | { 52 | Image = 0, 53 | Armature = 1, 54 | Mesh = 2 55 | }; 56 | 57 | enum class ArmatureType 58 | { 59 | Armature = 0, 60 | MovieClip = 1, 61 | Stage = 2 62 | }; 63 | 64 | enum class ExtensionType { 65 | FFD = 0, 66 | AdjustColor = 10, 67 | BevelFilter = 11, 68 | BlurFilter = 12, 69 | DropShadowFilter = 13, 70 | GlowFilter = 14, 71 | GradientBevelFilter = 15, 72 | GradientGlowFilter = 16 73 | }; 74 | 75 | enum class EventType { 76 | Frame = 0, 77 | Sound = 1 78 | }; 79 | 80 | enum class ActionType { 81 | Play = 0, 82 | Stop = 1, 83 | GotoAndPlay = 2, 84 | GotoAndStop = 3, 85 | FadeIn = 4, 86 | FadeOut = 5 87 | }; 88 | 89 | enum class BlendMode 90 | { 91 | Normal = 0, 92 | Add = 1, 93 | Alpha = 2, 94 | Darken = 3, 95 | Difference = 4, 96 | Erase = 5, 97 | HardLight = 6, 98 | Invert = 7, 99 | Layer = 8, 100 | Lighten = 9, 101 | Multiply = 10, 102 | Overlay = 11, 103 | Screen = 12, 104 | Subtract = 13 105 | }; 106 | 107 | const float PI = 3.14159265358979323846f; 108 | const float PI_D = PI * 2.0f; 109 | const float PI_H = PI * 0.5f; 110 | const float PI_Q = PI * 0.25f; 111 | const float ANGLE_TO_RADIAN = PI / 180.f; 112 | const float RADIAN_TO_ANGLE = 180.f / PI; 113 | const float SECOND_TO_MILLISECOND = 1000.f; 114 | const float NO_TWEEN = 100.f; 115 | // VERSION 4.7.2 116 | 117 | template 118 | std::string to_string(const T& value) 119 | { 120 | std::ostringstream stream; 121 | stream << value; 122 | return stream.str(); 123 | } 124 | 125 | template 126 | inline T* mapFind(const std::map& map, const std::string& key) 127 | { 128 | const auto iterator = map.find(key); 129 | return (iterator != map.end()) ? iterator->second : nullptr; 130 | } 131 | 132 | template 133 | inline int indexOf(const std::vector& vector, const T& value) 134 | { 135 | for (std::size_t i = 0, l = vector.size(); i < l; ++i) 136 | { 137 | if (vector[i] == value) 138 | { 139 | return (int) i; 140 | } 141 | } 142 | 143 | return -1; 144 | } 145 | 146 | DRAGONBONES_NAMESPACE_END 147 | 148 | #endif // DRAGONBONES_H 149 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/events/EventObject.cpp: -------------------------------------------------------------------------------- 1 | #include "EventObject.h" 2 | 3 | DRAGONBONES_NAMESPACE_BEGIN 4 | 5 | const char* EventObject::START = "start"; 6 | const char* EventObject::LOOP_COMPLETE = "loopComplete"; 7 | const char* EventObject::COMPLETE = "complete"; 8 | 9 | const char* EventObject::FADE_IN = "fadeIn"; 10 | const char* EventObject::FADE_IN_COMPLETE = "fadeInComplete"; 11 | const char* EventObject::FADE_OUT = "fadeOut"; 12 | const char* EventObject::FADE_OUT_COMPLETE = "fadeOutComplete"; 13 | 14 | const char* EventObject::FRAME_EVENT = "frameEvent"; 15 | const char* EventObject::SOUND_EVENT = "soundEvent"; 16 | 17 | IEventDispatcher* EventObject::_soundEventManager = nullptr; 18 | 19 | EventObject::EventObject() 20 | { 21 | _onClear(); 22 | } 23 | 24 | EventObject::~EventObject() 25 | { 26 | _onClear(); 27 | } 28 | 29 | void EventObject::_onClear() 30 | { 31 | type.clear(); 32 | name.clear(); 33 | //data = null; 34 | userData = nullptr; 35 | armature = nullptr; 36 | bone = nullptr; 37 | slot = nullptr; 38 | animationState = nullptr; 39 | frame = nullptr; 40 | } 41 | 42 | DRAGONBONES_NAMESPACE_END -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/events/EventObject.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_EVENT_OBJECT_H 2 | #define DRAGONBONES_EVENT_OBJECT_H 3 | 4 | #include "../core/BaseObject.h" 5 | 6 | DRAGONBONES_NAMESPACE_BEGIN 7 | 8 | class IEventDispatcher; 9 | class Armature; 10 | class Bone; 11 | class Slot; 12 | class AnimationState; 13 | class AnimationFrameData; 14 | 15 | class EventObject final : public BaseObject 16 | { 17 | BIND_CLASS_TYPE(EventObject); 18 | 19 | public: 20 | static const char* START; 21 | static const char* LOOP_COMPLETE; 22 | static const char* COMPLETE; 23 | 24 | static const char* FADE_IN; 25 | static const char* FADE_IN_COMPLETE; 26 | static const char* FADE_OUT; 27 | static const char* FADE_OUT_COMPLETE; 28 | 29 | static const char* FRAME_EVENT; 30 | static const char* SOUND_EVENT; 31 | 32 | public: 33 | /** @private */ 34 | static IEventDispatcher* _soundEventManager; 35 | 36 | public: 37 | std::string type; 38 | std::string name; 39 | //void* data; // TODO 40 | void* userData; 41 | Armature* armature; 42 | Bone* bone; 43 | Slot* slot; 44 | AnimationState* animationState; 45 | AnimationFrameData* frame; 46 | 47 | public: 48 | EventObject(); 49 | ~EventObject(); 50 | 51 | protected: 52 | void _onClear() override; 53 | 54 | private: 55 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(EventObject); 56 | }; 57 | 58 | class IEventDispatcher 59 | { 60 | protected: 61 | IEventDispatcher() {}; 62 | virtual ~IEventDispatcher() {}; 63 | 64 | public: 65 | /** @private */ 66 | virtual void _onClear() = 0; 67 | /** @private */ 68 | virtual void _dispatchEvent(EventObject* value) = 0; 69 | 70 | virtual bool hasEvent(const std::string& type) const = 0; 71 | }; 72 | 73 | DRAGONBONES_NAMESPACE_END 74 | #endif // DRAGONBONES_EVENT_OBJECT_H -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/geom/ColorTransform.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_COLOR_TRANSFORM_H 2 | #define DRAGONBONES_COLOR_TRANSFORM_H 3 | 4 | #include "../core/DragonBones.h" 5 | 6 | DRAGONBONES_NAMESPACE_BEGIN 7 | 8 | /** 9 | * @private 10 | */ 11 | class ColorTransform final 12 | { 13 | public: 14 | float alphaMultiplier; 15 | float redMultiplier; 16 | float greenMultiplier; 17 | float blueMultiplier; 18 | int alphaOffset; 19 | int redOffset; 20 | int greenOffset; 21 | int blueOffset; 22 | 23 | ColorTransform(): 24 | alphaMultiplier(1.f), 25 | redMultiplier(1.f), 26 | greenMultiplier(1.f), 27 | blueMultiplier(1.f), 28 | alphaOffset(0), 29 | redOffset(0), 30 | greenOffset(0), 31 | blueOffset(0) 32 | { 33 | } 34 | ColorTransform(const ColorTransform &value) 35 | { 36 | operator=(value); 37 | } 38 | ~ColorTransform() {} 39 | 40 | inline void operator=(const ColorTransform &value) 41 | { 42 | alphaMultiplier = value.alphaMultiplier; 43 | redMultiplier = value.redMultiplier; 44 | greenMultiplier = value.greenMultiplier; 45 | blueMultiplier = value.blueMultiplier; 46 | alphaOffset = value.alphaOffset; 47 | redOffset = value.redOffset; 48 | greenOffset = value.greenOffset; 49 | blueOffset = value.blueOffset; 50 | } 51 | 52 | inline void identity() 53 | { 54 | alphaMultiplier = redMultiplier = greenMultiplier = blueMultiplier = 1.f; 55 | alphaOffset = redOffset = greenOffset = blueOffset = 0; 56 | } 57 | }; 58 | 59 | DRAGONBONES_NAMESPACE_END 60 | #endif // DRAGONBONES_COLOR_TRANSFORM_H -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/geom/Matrix.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_MATRIX_H 2 | #define DRAGONBONES_MATRIX_H 3 | 4 | #include "../core/DragonBones.h" 5 | #include "Point.h" 6 | 7 | DRAGONBONES_NAMESPACE_BEGIN 8 | 9 | class Matrix final 10 | { 11 | public: 12 | float a; 13 | float b; 14 | float c; 15 | float d; 16 | float tx; 17 | float ty; 18 | 19 | Matrix(): 20 | a(1.f), 21 | b(0.f), 22 | c(0.f), 23 | d(1.f), 24 | tx(0.f), 25 | ty(0.f) 26 | { 27 | } 28 | Matrix(const Matrix& value) 29 | { 30 | operator=(value); 31 | } 32 | ~Matrix() {} 33 | 34 | inline void operator=(const Matrix& value) 35 | { 36 | a = value.a; 37 | b = value.b; 38 | c = value.c; 39 | d = value.d; 40 | tx = value.tx; 41 | ty = value.ty; 42 | } 43 | 44 | inline void identity() 45 | { 46 | a = d = 1.f; 47 | b = c = 0.f; 48 | tx = ty = 0.f; 49 | } 50 | 51 | inline void concat(const Matrix& value) 52 | { 53 | const auto aA = a; 54 | const auto bA = b; 55 | const auto cA = c; 56 | const auto dA = d; 57 | const auto txA = tx; 58 | const auto tyA = ty; 59 | const auto aB = value.a; 60 | const auto bB = value.b; 61 | const auto cB = value.c; 62 | const auto dB = value.d; 63 | const auto txB = value.tx; 64 | const auto tyB = value.ty; 65 | 66 | a = aA * aB + bA * cB; 67 | b = aA * bB + bA * dB; 68 | c = cA * aB + dA * cB; 69 | d = cA * bB + dA * dB; 70 | tx = aB * txA + cB * tyA + txB; 71 | ty = dB * tyA + bB * txA + tyB; 72 | } 73 | 74 | inline void invert() 75 | { 76 | const auto aA = a; 77 | const auto bA = b; 78 | const auto cA = c; 79 | const auto dA = d; 80 | const auto txA = tx; 81 | const auto tyA = ty; 82 | const auto n = aA * dA - bA * cA; 83 | 84 | a = dA / n; 85 | b = -bA / n; 86 | c = -cA / n; 87 | d = aA / n; 88 | tx = (cA * tyA - dA * txA) / n; 89 | ty = -(aA * tyA - bA * txA) / n; 90 | } 91 | 92 | inline void transformPoint(float x, float y, Point& result, bool delta = false) const 93 | { 94 | result.x = a * x + c * y; 95 | result.y = b * x + d * y; 96 | 97 | if (!delta) 98 | { 99 | result.x += tx; 100 | result.y += ty; 101 | } 102 | } 103 | }; 104 | 105 | DRAGONBONES_NAMESPACE_END 106 | #endif // DRAGONBONES_MATRIX_H -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/geom/Point.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_POINT_H 2 | #define DRAGONBONES_POINT_H 3 | 4 | #include "../core/DragonBones.h" 5 | 6 | DRAGONBONES_NAMESPACE_BEGIN 7 | 8 | /** 9 | * @private 10 | */ 11 | class Point final 12 | { 13 | public: 14 | float x; 15 | float y; 16 | 17 | Point(): 18 | x(0.f), 19 | y(0.f) 20 | { 21 | } 22 | Point(const Point& value) 23 | { 24 | operator=(value); 25 | } 26 | ~Point() {} 27 | 28 | inline void operator=(const Point& value) 29 | { 30 | x = value.x; 31 | y = value.y; 32 | } 33 | 34 | inline void clear() 35 | { 36 | x = y = 0.f; 37 | } 38 | }; 39 | 40 | DRAGONBONES_NAMESPACE_END 41 | #endif // DRAGONBONES_POINT_H -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/geom/Rectangle.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_RECTANGLE_H 2 | #define DRAGONBONES_RECTANGLE_H 3 | 4 | #include "../core/DragonBones.h" 5 | 6 | DRAGONBONES_NAMESPACE_BEGIN 7 | 8 | /** 9 | * @private 10 | */ 11 | class Rectangle final 12 | { 13 | public: 14 | float x; 15 | float y; 16 | float width; 17 | float height; 18 | 19 | Rectangle(): 20 | x(0.f), 21 | y(0.f), 22 | width(0.f), 23 | height(0.f) 24 | { 25 | } 26 | Rectangle(const Rectangle& value) 27 | { 28 | operator=(value); 29 | } 30 | ~Rectangle() {} 31 | 32 | inline void operator=(const Rectangle& value) 33 | { 34 | x = value.x; 35 | y = value.y; 36 | width = value.width; 37 | height = value.height; 38 | } 39 | 40 | void clear() 41 | { 42 | x = y = 0.f; 43 | width = height = 0.f; 44 | } 45 | }; 46 | 47 | DRAGONBONES_NAMESPACE_END 48 | #endif // DRAGONBONES_RECTANGLE_H -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/model/AnimationData.cpp: -------------------------------------------------------------------------------- 1 | #include "AnimationData.h" 2 | #include "ArmatureData.h" 3 | 4 | DRAGONBONES_NAMESPACE_BEGIN 5 | 6 | AnimationData::AnimationData() 7 | { 8 | _onClear(); 9 | } 10 | AnimationData::~AnimationData() 11 | { 12 | _onClear(); 13 | } 14 | 15 | void AnimationData::_onClear() 16 | { 17 | TimelineData::_onClear(); 18 | 19 | for (const auto& pair : boneTimelines) 20 | { 21 | pair.second->returnToPool(); 22 | } 23 | 24 | for (const auto& pair : slotTimelines) 25 | { 26 | pair.second->returnToPool(); 27 | } 28 | 29 | for (const auto& skinPair : ffdTimelines) 30 | { 31 | for (const auto& slotPair : skinPair.second) 32 | { 33 | for (const auto& pair : slotPair.second) 34 | { 35 | pair.second->returnToPool(); 36 | } 37 | } 38 | } 39 | 40 | hasAsynchronyTimeline = false; 41 | frameCount = 0; 42 | playTimes = 0; 43 | position = 0.f; 44 | duration = 0.f; 45 | fadeInTime = 0.f; 46 | cacheTimeToFrameScale = 0.f; 47 | name.clear(); 48 | animation = nullptr; 49 | boneTimelines.clear(); 50 | slotTimelines.clear(); 51 | ffdTimelines.clear(); 52 | cachedFrames.clear(); 53 | } 54 | 55 | void AnimationData::cacheFrames(float value) 56 | { 57 | if (animation) 58 | { 59 | return; 60 | } 61 | 62 | const auto cacheFrameCount = (unsigned)std::max(std::floor((frameCount + 1) * scale * value), 1.f); 63 | 64 | cacheTimeToFrameScale = cacheFrameCount / (duration + 0.0000001f); 65 | cachedFrames.resize(cacheFrameCount, false); 66 | 67 | for (const auto& pair : boneTimelines) 68 | { 69 | pair.second->cacheFrames(cacheFrameCount); 70 | } 71 | 72 | for (const auto& pair : slotTimelines) 73 | { 74 | pair.second->cacheFrames(cacheFrameCount); 75 | } 76 | } 77 | 78 | void AnimationData::addBoneTimeline(BoneTimelineData* value) 79 | { 80 | if (value && value->bone && boneTimelines.find(value->bone->name) == boneTimelines.end()) 81 | { 82 | boneTimelines[value->bone->name] = value; 83 | } 84 | else 85 | { 86 | DRAGONBONES_ASSERT(false, "Argument error."); 87 | } 88 | } 89 | 90 | void AnimationData::addSlotTimeline(SlotTimelineData* value) 91 | { 92 | if (value && value->slot && slotTimelines.find(value->slot->name) == slotTimelines.end()) 93 | { 94 | slotTimelines[value->slot->name] = value; 95 | } 96 | else 97 | { 98 | DRAGONBONES_ASSERT(false, "Argument error."); 99 | } 100 | } 101 | 102 | void AnimationData::addFFDTimeline(FFDTimelineData* value) 103 | { 104 | if (value && value->skin && value->slot) 105 | { 106 | const auto& skinName = value->skin->name; 107 | const auto& slotName = value->slot->slot->name; 108 | const auto& displayIndex = to_string(value->displayIndex); // std::to_string 109 | 110 | auto& skin = ffdTimelines[skinName]; 111 | auto& slot = skin[slotName]; 112 | if (slot.find(displayIndex) == slot.end()) 113 | { 114 | slot[displayIndex] = value; 115 | } 116 | else 117 | { 118 | DRAGONBONES_ASSERT(false, "Argument error."); 119 | } 120 | } 121 | else 122 | { 123 | DRAGONBONES_ASSERT(false, "Argument error."); 124 | } 125 | } 126 | 127 | DRAGONBONES_NAMESPACE_END -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/model/AnimationData.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_ANIMATION_DATA_H 2 | #define DRAGONBONES_ANIMATION_DATA_H 3 | 4 | #include "TimelineData.h" 5 | 6 | DRAGONBONES_NAMESPACE_BEGIN 7 | 8 | class AnimationData final : public TimelineData 9 | { 10 | BIND_CLASS_TYPE(AnimationData); 11 | 12 | public: 13 | /** @private */ 14 | bool hasAsynchronyTimeline; 15 | unsigned frameCount; 16 | unsigned playTimes; 17 | float position; 18 | float duration; 19 | float fadeInTime; 20 | /** @private */ 21 | float cacheTimeToFrameScale; 22 | std::string name; 23 | /** @private */ 24 | AnimationData* animation; 25 | /** @private */ 26 | std::map boneTimelines; 27 | /** @private */ 28 | std::map slotTimelines; 29 | /** @private */ 30 | std::map>> ffdTimelines; // skin slot displayIndex 31 | /** @private */ 32 | std::vector cachedFrames; 33 | 34 | /** @private */ 35 | AnimationData(); 36 | /** @private */ 37 | ~AnimationData(); 38 | 39 | private: 40 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(AnimationData); 41 | 42 | protected: 43 | void _onClear() override; 44 | 45 | public: 46 | /** @private */ 47 | void cacheFrames(float value); 48 | /** @private */ 49 | void addBoneTimeline(BoneTimelineData* value); 50 | /** @private */ 51 | void addSlotTimeline(SlotTimelineData* value); 52 | /** @private */ 53 | void addFFDTimeline(FFDTimelineData* value); 54 | 55 | /** @private */ 56 | inline BoneTimelineData* getBoneTimeline(const std::string& theName) const 57 | { 58 | return mapFind(boneTimelines, theName); 59 | } 60 | 61 | /** @private */ 62 | inline SlotTimelineData* getSlotTimeline(const std::string& theName) const 63 | { 64 | return mapFind(slotTimelines, theName); 65 | } 66 | 67 | /** @private */ 68 | inline FFDTimelineData* getFFDTimeline(const std::string& skinName, const std::string& slotName, unsigned displayIndex) const 69 | { 70 | const auto iteratorSkin = ffdTimelines.find(skinName); 71 | if (iteratorSkin != ffdTimelines.end()) 72 | { 73 | const auto& skin = iteratorSkin->second; 74 | const auto iteratorSlot = skin.find(slotName); 75 | if (iteratorSlot != skin.end()) 76 | { 77 | const auto& slot = iteratorSlot->second; 78 | return mapFind(slot, to_string(displayIndex)); // std::to_string 79 | } 80 | } 81 | 82 | return nullptr; 83 | } 84 | }; 85 | 86 | DRAGONBONES_NAMESPACE_END 87 | #endif // DRAGONBONES_ANIMATION_DATA_H 88 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/model/DragonBonesData.cpp: -------------------------------------------------------------------------------- 1 | #include "DragonBonesData.h" 2 | 3 | DRAGONBONES_NAMESPACE_BEGIN 4 | 5 | DragonBonesData::DragonBonesData() 6 | { 7 | _onClear(); 8 | } 9 | DragonBonesData::~DragonBonesData() 10 | { 11 | _onClear(); 12 | } 13 | 14 | void DragonBonesData::_onClear() 15 | { 16 | autoSearch = false; 17 | frameRate = 0; 18 | name.clear(); 19 | 20 | for (const auto& pair : armatures) 21 | { 22 | pair.second->returnToPool(); 23 | } 24 | 25 | armatures.clear(); 26 | 27 | _armatureNames.clear(); 28 | } 29 | 30 | void DragonBonesData::addArmature(ArmatureData * value) 31 | { 32 | if (value && !value->name.empty() && armatures.find(value->name) == armatures.end()) 33 | { 34 | armatures[value->name] = value; 35 | _armatureNames.push_back(value->name); 36 | value->parent = this; 37 | } 38 | else 39 | { 40 | DRAGONBONES_ASSERT(false, "Argument error."); 41 | } 42 | } 43 | 44 | DRAGONBONES_NAMESPACE_END 45 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/model/DragonBonesData.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_DRAGONBONES_DATA_H 2 | #define DRAGONBONES_DRAGONBONES_DATA_H 3 | 4 | #include "../core/BaseObject.h" 5 | #include "ArmatureData.h" 6 | 7 | DRAGONBONES_NAMESPACE_BEGIN 8 | 9 | class DragonBonesData : public BaseObject 10 | { 11 | BIND_CLASS_TYPE(DragonBonesData); 12 | 13 | public: 14 | bool autoSearch; 15 | unsigned frameRate; 16 | std::string name; 17 | std::map armatures; 18 | 19 | private: 20 | std::vector _armatureNames; 21 | 22 | public: 23 | /** @private */ 24 | DragonBonesData(); 25 | /** @private */ 26 | ~DragonBonesData(); 27 | 28 | private: 29 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(DragonBonesData); 30 | 31 | protected: 32 | void _onClear() override; 33 | 34 | public: 35 | /** @private */ 36 | void addArmature(ArmatureData* value); 37 | 38 | inline ArmatureData* getArmature(const std::string& theName) const 39 | { 40 | return mapFind(armatures, theName); 41 | } 42 | 43 | inline const std::vector& getArmatureNames() const 44 | { 45 | return _armatureNames; 46 | } 47 | }; 48 | 49 | DRAGONBONES_NAMESPACE_END 50 | #endif // DRAGONBONES_DRAGONBONES_DATA_H 51 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/model/FrameData.cpp: -------------------------------------------------------------------------------- 1 | #include "FrameData.h" 2 | 3 | DRAGONBONES_NAMESPACE_BEGIN 4 | 5 | ActionData::ActionData() 6 | { 7 | _onClear(); 8 | } 9 | ActionData::~ActionData() 10 | { 11 | _onClear(); 12 | } 13 | 14 | void ActionData::_onClear() 15 | { 16 | type = ActionType::Play; 17 | bone = nullptr; 18 | slot = nullptr; 19 | 20 | std::get<0>(data).clear(); 21 | std::get<1>(data).clear(); 22 | std::get<2>(data).clear(); 23 | } 24 | 25 | EventData::EventData() 26 | { 27 | _onClear(); 28 | } 29 | EventData::~EventData() 30 | { 31 | _onClear(); 32 | } 33 | 34 | void EventData::_onClear() 35 | { 36 | type = EventType::Frame; 37 | name.clear(); 38 | //data = nullptr; 39 | bone = nullptr; 40 | slot = nullptr; 41 | } 42 | 43 | AnimationFrameData::AnimationFrameData() 44 | { 45 | _onClear(); 46 | } 47 | AnimationFrameData::~AnimationFrameData() 48 | { 49 | _onClear(); 50 | } 51 | 52 | void AnimationFrameData::_onClear() 53 | { 54 | FrameData::_onClear(); 55 | } 56 | 57 | BoneFrameData::BoneFrameData() 58 | { 59 | _onClear(); 60 | } 61 | BoneFrameData::~BoneFrameData() 62 | { 63 | _onClear(); 64 | } 65 | 66 | void BoneFrameData::_onClear() 67 | { 68 | TweenFrameData::_onClear(); 69 | 70 | tweenScale = false; 71 | tweenRotate = 0; 72 | parent = nullptr; 73 | transform.identity(); 74 | } 75 | 76 | ColorTransform SlotFrameData::DEFAULT_COLOR; 77 | ColorTransform * SlotFrameData::generateColor() 78 | { 79 | return new ColorTransform(); 80 | } 81 | 82 | SlotFrameData::SlotFrameData() : 83 | color(nullptr) 84 | { 85 | _onClear(); 86 | } 87 | SlotFrameData::~SlotFrameData() 88 | { 89 | _onClear(); 90 | } 91 | 92 | void SlotFrameData::_onClear() 93 | { 94 | TweenFrameData::_onClear(); 95 | 96 | displayIndex = 0; 97 | zOrder = 0; 98 | 99 | if (color) 100 | { 101 | if (color != &DEFAULT_COLOR) 102 | { 103 | delete color; 104 | } 105 | 106 | color = nullptr; 107 | } 108 | } 109 | 110 | ExtensionFrameData::ExtensionFrameData() 111 | { 112 | _onClear(); 113 | } 114 | ExtensionFrameData::~ExtensionFrameData() 115 | { 116 | _onClear(); 117 | } 118 | 119 | void ExtensionFrameData::_onClear() 120 | { 121 | TweenFrameData::_onClear(); 122 | 123 | type = ExtensionType::FFD; 124 | tweens.clear(); 125 | keys.clear(); 126 | } 127 | 128 | DRAGONBONES_NAMESPACE_END 129 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/model/TimelineData.cpp: -------------------------------------------------------------------------------- 1 | #include "TimelineData.h" 2 | 3 | DRAGONBONES_NAMESPACE_BEGIN 4 | 5 | Matrix* BoneTimelineData::cacheFrame(std::vector& cacheFrames, std::size_t cacheFrameIndex, const Matrix& globalTransformMatrix) 6 | { 7 | const auto cacheMatrix = cacheFrames[cacheFrameIndex] = new Matrix(); 8 | *cacheMatrix = globalTransformMatrix; 9 | 10 | return cacheMatrix; 11 | } 12 | 13 | BoneTimelineData::BoneTimelineData() 14 | { 15 | _onClear(); 16 | } 17 | BoneTimelineData::~BoneTimelineData() 18 | { 19 | _onClear(); 20 | } 21 | 22 | void BoneTimelineData::_onClear() 23 | { 24 | TimelineData::_onClear(); 25 | 26 | bone = nullptr; 27 | originTransform.identity(); 28 | 29 | Matrix* prevMatrix = nullptr; 30 | for (const auto matrix : cachedFrames) 31 | { 32 | if (matrix) 33 | { 34 | if (prevMatrix && prevMatrix != matrix) 35 | { 36 | delete prevMatrix; 37 | } 38 | 39 | prevMatrix = matrix; 40 | } 41 | } 42 | 43 | cachedFrames.clear(); 44 | } 45 | 46 | void BoneTimelineData::cacheFrames(std::size_t cacheFrameCount) 47 | { 48 | Matrix* prevMatrix = nullptr; 49 | for (const auto matrix : cachedFrames) 50 | { 51 | if (matrix) 52 | { 53 | if (prevMatrix && prevMatrix != matrix) 54 | { 55 | delete prevMatrix; 56 | } 57 | 58 | prevMatrix = matrix; 59 | } 60 | } 61 | 62 | cachedFrames.clear(); 63 | cachedFrames.resize(cacheFrameCount, nullptr); 64 | } 65 | 66 | Matrix* SlotTimelineData::cacheFrame(std::vector& cacheFrames, std::size_t cacheFrameIndex, const Matrix& globalTransformMatrix) 67 | { 68 | const auto cacheMatrix = cacheFrames[cacheFrameIndex] = new Matrix(); 69 | *cacheMatrix = globalTransformMatrix; 70 | 71 | return cacheMatrix; 72 | } 73 | 74 | SlotTimelineData::SlotTimelineData() 75 | { 76 | _onClear(); 77 | } 78 | SlotTimelineData::~SlotTimelineData() 79 | { 80 | _onClear(); 81 | } 82 | 83 | void SlotTimelineData::_onClear() 84 | { 85 | TimelineData::_onClear(); 86 | 87 | slot = nullptr; 88 | 89 | Matrix* prevMatrix = nullptr; 90 | for (const auto matrix : cachedFrames) 91 | { 92 | if (matrix) 93 | { 94 | if (prevMatrix && prevMatrix != matrix) 95 | { 96 | delete prevMatrix; 97 | } 98 | 99 | prevMatrix = matrix; 100 | } 101 | } 102 | 103 | cachedFrames.clear(); 104 | } 105 | 106 | void SlotTimelineData::cacheFrames(std::size_t cacheFrameCount) 107 | { 108 | Matrix* prevMatrix = nullptr; 109 | for (const auto matrix : cachedFrames) 110 | { 111 | if (matrix) 112 | { 113 | if (prevMatrix && prevMatrix != matrix) 114 | { 115 | delete prevMatrix; 116 | } 117 | 118 | prevMatrix = matrix; 119 | } 120 | } 121 | 122 | cachedFrames.clear(); 123 | cachedFrames.resize(cacheFrameCount, nullptr); 124 | } 125 | 126 | FFDTimelineData::FFDTimelineData() 127 | { 128 | _onClear(); 129 | } 130 | FFDTimelineData::~FFDTimelineData() 131 | { 132 | _onClear(); 133 | } 134 | 135 | void FFDTimelineData::_onClear() 136 | { 137 | TimelineData::_onClear(); 138 | 139 | displayIndex = 0; 140 | skin = nullptr; 141 | slot = nullptr; 142 | } 143 | 144 | DRAGONBONES_NAMESPACE_END -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/model/TimelineData.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_TIMELINE_DATA_H 2 | #define DRAGONBONES_TIMELINE_DATA_H 3 | 4 | #include "../core/BaseObject.h" 5 | #include "FrameData.h" 6 | 7 | DRAGONBONES_NAMESPACE_BEGIN 8 | 9 | class SkinData; 10 | class SlotDisplayDataSet; 11 | 12 | /** 13 | * @private 14 | */ 15 | template 16 | class TimelineData : public BaseObject 17 | { 18 | public: 19 | float scale; 20 | float offset; 21 | 22 | std::vector frames; 23 | 24 | TimelineData() {} 25 | virtual ~TimelineData() {} 26 | 27 | protected: 28 | virtual void _onClear() override 29 | { 30 | scale = 1.f; 31 | offset = 0.f; 32 | 33 | T* prevFrame = nullptr; 34 | for (const auto frame : frames) 35 | { 36 | if (prevFrame && frame != prevFrame) 37 | { 38 | prevFrame->returnToPool(); 39 | } 40 | 41 | prevFrame = frame; 42 | } 43 | 44 | frames.clear(); 45 | } 46 | }; 47 | 48 | /** 49 | * @private 50 | */ 51 | class BoneTimelineData final : public TimelineData 52 | { 53 | BIND_CLASS_TYPE(BoneTimelineData); 54 | 55 | public: 56 | static Matrix* cacheFrame(std::vector& cacheFrames, std::size_t cacheFrameIndex, const Matrix& globalTransformMatrix); 57 | 58 | public: 59 | BoneData* bone; 60 | Transform originTransform; 61 | std::vector cachedFrames; 62 | 63 | BoneTimelineData(); 64 | ~BoneTimelineData(); 65 | 66 | private: 67 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(BoneTimelineData); 68 | 69 | protected: 70 | void _onClear() override; 71 | 72 | public: 73 | /** @private */ 74 | void cacheFrames(std::size_t cacheFrameCount); 75 | }; 76 | 77 | /** 78 | * @private 79 | */ 80 | class SlotTimelineData final : public TimelineData 81 | { 82 | BIND_CLASS_TYPE(SlotTimelineData); 83 | 84 | public: 85 | static Matrix* cacheFrame(std::vector& cacheFrames, std::size_t cacheFrameIndex, const Matrix& globalTransformMatrix); 86 | 87 | public: 88 | SlotData* slot; 89 | std::vector cachedFrames; 90 | 91 | SlotTimelineData(); 92 | ~SlotTimelineData(); 93 | 94 | private: 95 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(SlotTimelineData); 96 | 97 | protected: 98 | void _onClear() override; 99 | 100 | public: 101 | /** @private */ 102 | void cacheFrames(std::size_t cacheFrameCount); 103 | }; 104 | 105 | /** 106 | * @private 107 | */ 108 | class FFDTimelineData final : public TimelineData 109 | { 110 | BIND_CLASS_TYPE(FFDTimelineData); 111 | 112 | public: 113 | std::size_t displayIndex; 114 | SkinData* skin; 115 | SlotDisplayDataSet* slot; 116 | 117 | FFDTimelineData(); 118 | ~FFDTimelineData(); 119 | 120 | private: 121 | DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(FFDTimelineData); 122 | 123 | protected: 124 | void _onClear() override; 125 | }; 126 | 127 | DRAGONBONES_NAMESPACE_END 128 | #endif // DRAGONBONES_TIMELINE_DATA_H 129 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/textures/TextureData.cpp: -------------------------------------------------------------------------------- 1 | #include "TextureData.h" 2 | 3 | DRAGONBONES_NAMESPACE_BEGIN 4 | 5 | Rectangle* TextureData::generateRectangle() 6 | { 7 | return new Rectangle(); 8 | } 9 | 10 | TextureData::TextureData() : 11 | frame(nullptr) 12 | {} 13 | TextureData::~TextureData() {} 14 | 15 | void TextureData::_onClear() 16 | { 17 | rotated = false; 18 | name.clear(); 19 | 20 | if (frame) 21 | { 22 | delete frame; 23 | frame = nullptr; 24 | } 25 | 26 | parent = nullptr; 27 | region.clear(); 28 | } 29 | 30 | TextureAtlasData::TextureAtlasData() {} 31 | TextureAtlasData::~TextureAtlasData() {} 32 | 33 | void TextureAtlasData::_onClear() 34 | { 35 | for (const auto& pair : textures) 36 | { 37 | pair.second->returnToPool(); 38 | } 39 | 40 | autoSearch = false; 41 | format = TextureFormat::DEFAULT; 42 | scale = 1.f; 43 | name.clear(); 44 | imagePath.clear(); 45 | textures.clear(); 46 | } 47 | 48 | void TextureAtlasData::addTexture(TextureData * value) 49 | { 50 | if (value && !value->name.empty() && textures.find(value->name) == textures.end()) 51 | { 52 | textures[value->name] = value; 53 | value->parent = this; 54 | } 55 | else 56 | { 57 | DRAGONBONES_ASSERT(false, "Argument error."); 58 | } 59 | } 60 | 61 | DRAGONBONES_NAMESPACE_END -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/dragonbones/textures/TextureData.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAGONBONES_TEXTURE_DATA_H 2 | #define DRAGONBONES_TEXTURE_DATA_H 3 | 4 | #include "../core/BaseObject.h" 5 | #include "../geom/Rectangle.h" 6 | 7 | DRAGONBONES_NAMESPACE_BEGIN 8 | 9 | class TextureAtlasData; 10 | 11 | /** 12 | * @private 13 | */ 14 | class TextureData : public BaseObject 15 | { 16 | public: 17 | static Rectangle* generateRectangle(); 18 | 19 | public: 20 | bool rotated; 21 | std::string name; 22 | Rectangle* frame; 23 | TextureAtlasData* parent; 24 | Rectangle region; 25 | 26 | TextureData(); 27 | virtual ~TextureData() = 0; 28 | 29 | protected: 30 | virtual void _onClear() override; 31 | }; 32 | 33 | class TextureAtlasData : public BaseObject 34 | { 35 | public: 36 | bool autoSearch; 37 | float scale; 38 | TextureFormat format; 39 | std::string name; 40 | std::string imagePath; 41 | /** @private */ 42 | std::map textures; 43 | 44 | /** @private */ 45 | TextureAtlasData(); 46 | /** @private */ 47 | virtual ~TextureAtlasData() = 0; 48 | 49 | protected: 50 | virtual void _onClear() override; 51 | 52 | public: 53 | /** @private */ 54 | virtual TextureData* generateTexture() const = 0; 55 | /** @private */ 56 | virtual void addTexture(TextureData* value); 57 | /** @private */ 58 | inline TextureData* getTexture(const std::string& texName) const 59 | { 60 | return mapFind(textures, texName); 61 | } 62 | }; 63 | 64 | DRAGONBONES_NAMESPACE_END 65 | #endif // DRAGONBONES_TEXTURE_DATA_H 66 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/flatbuffers/grpc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Google Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLATBUFFERS_GRPC_H_ 18 | #define FLATBUFFERS_GRPC_H_ 19 | 20 | // Helper functionality to glue FlatBuffers and GRPC. 21 | 22 | #include "grpc++/support/byte_buffer.h" 23 | #include "grpc/byte_buffer_reader.h" 24 | 25 | namespace grpc { 26 | 27 | template 28 | class SerializationTraits::value>::type> { 30 | public: 31 | // The type we're passing here is a BufferRef, which is already serialized 32 | // FlatBuffer data, which then gets passed to GRPC. 33 | static grpc::Status Serialize(const T& msg, 34 | grpc_byte_buffer **buffer, 35 | bool *own_buffer) { 36 | // TODO(wvo): make this work without copying. 37 | auto slice = gpr_slice_from_copied_buffer( 38 | reinterpret_cast(msg.buf), msg.len); 39 | *buffer = grpc_raw_byte_buffer_create(&slice, 1); 40 | *own_buffer = true; 41 | return grpc::Status(); 42 | } 43 | 44 | // There is no de-serialization step in FlatBuffers, so we just receive 45 | // the data from GRPC. 46 | static grpc::Status Deserialize(grpc_byte_buffer *buffer, 47 | T *msg, 48 | int max_message_size) { 49 | // TODO(wvo): make this more efficient / zero copy when possible. 50 | auto len = grpc_byte_buffer_length(buffer); 51 | msg->buf = reinterpret_cast(malloc(len)); 52 | msg->len = static_cast(len); 53 | msg->must_free = true; 54 | uint8_t *current = msg->buf; 55 | grpc_byte_buffer_reader reader; 56 | grpc_byte_buffer_reader_init(&reader, buffer); 57 | gpr_slice slice; 58 | while (grpc_byte_buffer_reader_next(&reader, &slice)) { 59 | memcpy(current, GPR_SLICE_START_PTR(slice), GPR_SLICE_LENGTH(slice)); 60 | current += GPR_SLICE_LENGTH(slice); 61 | gpr_slice_unref(slice); 62 | } 63 | GPR_ASSERT(current == msg->buf + msg->len); 64 | grpc_byte_buffer_reader_destroy(&reader); 65 | grpc_byte_buffer_destroy(buffer); 66 | return grpc::Status(); 67 | } 68 | }; 69 | 70 | } // namespace grpc; 71 | 72 | #endif // FLATBUFFERS_GRPC_H_ 73 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/flatbuffers/hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Google Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLATBUFFERS_HASH_H_ 18 | #define FLATBUFFERS_HASH_H_ 19 | 20 | #include 21 | #include 22 | 23 | #include "flatbuffers/flatbuffers.h" 24 | 25 | namespace flatbuffers { 26 | 27 | template 28 | struct FnvTraits { 29 | static const T kFnvPrime; 30 | static const T kOffsetBasis; 31 | }; 32 | 33 | template <> 34 | struct FnvTraits { 35 | static const uint32_t kFnvPrime = 0x01000193; 36 | static const uint32_t kOffsetBasis = 0x811C9DC5; 37 | }; 38 | 39 | template <> 40 | struct FnvTraits { 41 | static const uint64_t kFnvPrime = 0x00000100000001b3ULL; 42 | static const uint64_t kOffsetBasis = 0xcbf29ce484222645ULL; 43 | }; 44 | 45 | template 46 | T HashFnv1(const char *input) { 47 | T hash = FnvTraits::kOffsetBasis; 48 | for (const char *c = input; *c; ++c) { 49 | hash *= FnvTraits::kFnvPrime; 50 | hash ^= static_cast(*c); 51 | } 52 | return hash; 53 | } 54 | 55 | template 56 | T HashFnv1a(const char *input) { 57 | T hash = FnvTraits::kOffsetBasis; 58 | for (const char *c = input; *c; ++c) { 59 | hash ^= static_cast(*c); 60 | hash *= FnvTraits::kFnvPrime; 61 | } 62 | return hash; 63 | } 64 | 65 | template 66 | struct NamedHashFunction { 67 | const char *name; 68 | 69 | typedef T (*HashFunction)(const char*); 70 | HashFunction function; 71 | }; 72 | 73 | const NamedHashFunction kHashFunctions32[] = { 74 | { "fnv1_32", HashFnv1 }, 75 | { "fnv1a_32", HashFnv1a }, 76 | }; 77 | 78 | const NamedHashFunction kHashFunctions64[] = { 79 | { "fnv1_64", HashFnv1 }, 80 | { "fnv1a_64", HashFnv1a }, 81 | }; 82 | 83 | inline NamedHashFunction::HashFunction FindHashFunction32( 84 | const char *name) { 85 | std::size_t size = sizeof(kHashFunctions32) / sizeof(kHashFunctions32[0]); 86 | for (std::size_t i = 0; i < size; ++i) { 87 | if (std::strcmp(name, kHashFunctions32[i].name) == 0) { 88 | return kHashFunctions32[i].function; 89 | } 90 | } 91 | return nullptr; 92 | } 93 | 94 | inline NamedHashFunction::HashFunction FindHashFunction64( 95 | const char *name) { 96 | std::size_t size = sizeof(kHashFunctions64) / sizeof(kHashFunctions64[0]); 97 | for (std::size_t i = 0; i < size; ++i) { 98 | if (std::strcmp(name, kHashFunctions64[i].name) == 0) { 99 | return kHashFunctions64[i].function; 100 | } 101 | } 102 | return nullptr; 103 | } 104 | 105 | } // namespace flatbuffers 106 | 107 | #endif // FLATBUFFERS_HASH_H_ 108 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/lua-bindings/creator_reader_bindings.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #include "lua-bindings/creator_reader_bindings.hpp" 25 | 26 | #include "scripting/lua-bindings/manual/CCLuaEngine.h" 27 | 28 | #include "lua-bindings/reader/lua_creator_reader_auto.hpp" 29 | #include "lua-bindings/reader/lua_creator_reader_manual.hpp" 30 | 31 | #include "lua-bindings/dragonbones/lua_dragonbones_auto.hpp" 32 | #include "lua-bindings/dragonbones/lua_dragonbones_manual.hpp" 33 | 34 | int register_creator_reader_module(lua_State* L) 35 | { 36 | if (nullptr == L) 37 | return 0; 38 | 39 | register_all_creator_reader(L); 40 | register_all_creator_reader_manual(L); 41 | 42 | register_all_creator_dragonbones(L); 43 | register_all_creator_dragonbones_manual(L); 44 | 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/lua-bindings/creator_reader_bindings.hpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | #include "tolua++.h" 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | TOLUA_API int register_creator_reader_module(lua_State* L); 35 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/lua-bindings/dragonbones/lua_dragonbones_auto.hpp: -------------------------------------------------------------------------------- 1 | #include "base/ccConfig.h" 2 | #ifndef __creator_dragonbones_h__ 3 | #define __creator_dragonbones_h__ 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | #include "tolua++.h" 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | int register_all_creator_dragonbones(lua_State* tolua_S); 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | #endif // __creator_dragonbones_h__ 132 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/lua-bindings/dragonbones/lua_dragonbones_manual.hpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | #include "tolua++.h" 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | TOLUA_API int register_all_creator_dragonbones_manual(lua_State* L); 35 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/lua-bindings/reader/lua_creator_reader_auto.hpp: -------------------------------------------------------------------------------- 1 | #include "base/ccConfig.h" 2 | #ifndef __creator_reader_h__ 3 | #define __creator_reader_h__ 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | #include "tolua++.h" 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | int register_all_creator_reader(lua_State* tolua_S); 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | #endif // __creator_reader_h__ 45 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/lua-bindings/reader/lua_creator_reader_manual.hpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | #include "tolua++.h" 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | TOLUA_API int register_all_creator_reader_manual(lua_State* L); 35 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/ui/PageView.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #include "PageView.h" 25 | 26 | 27 | NS_CCR_BEGIN 28 | 29 | CreatorPageView* CreatorPageView::create() 30 | { 31 | auto pageview = new (std::nothrow) CreatorPageView(); 32 | if (pageview && pageview->init()) 33 | { 34 | pageview->autorelease(); 35 | return pageview; 36 | } 37 | 38 | delete pageview; 39 | return nullptr; 40 | } 41 | 42 | void CreatorPageView::remedyLayoutParameter(cocos2d::ui::Widget* item) 43 | { 44 | ListView::remedyLayoutParameter(item); 45 | } 46 | 47 | NS_CCR_END 48 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/ui/PageView.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | #include "cocos2d.h" 27 | #include "ui/CocosGUI.h" 28 | 29 | #include "Macros.h" 30 | 31 | NS_CCR_BEGIN 32 | 33 | class CreatorPageView : public cocos2d::ui::PageView 34 | { 35 | public: 36 | static CreatorPageView* create(); 37 | 38 | // page size can be not the same as PageView content size 39 | virtual void remedyLayoutParameter(cocos2d::ui::Widget* item) override; 40 | }; 41 | 42 | NS_CCR_END 43 | -------------------------------------------------------------------------------- /creator_project/packages/creator-luacpp-support/reader/ui/RichtextStringVisitor.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include "cocos2d.h" 29 | 30 | #include "Macros.h" 31 | 32 | NS_CCR_BEGIN 33 | 34 | class RichtextStringVisitor : public cocos2d::SAXDelegator 35 | { 36 | public: 37 | RichtextStringVisitor(); 38 | 39 | virtual void startElement(void *ctx, const char *name, const char **atts) override; 40 | virtual void endElement(void *ctx, const char *name) override; 41 | virtual void textHandler(void *ctx, const char *s, size_t len) override; 42 | 43 | const std::string& getOutput() const; 44 | const std::string& getRawString() const; 45 | int getMaxFontSize() const; 46 | 47 | private: 48 | 49 | std::string convertColorString2Hex(const std::string& colorString) const; 50 | std::string convertAttributeName(const std::string& tagName, const std::string& attributeName) const; 51 | std::string convertAttributeValue(const std::string& tagName, const std::string& attributeName, const std::string& attributeValue) const; 52 | 53 | const static std::string COLOR_FLAG; 54 | const static std::string SIZE_FLAG; 55 | const static std::string IMG_FLAG; 56 | const static std::string BR_FLAG; 57 | const static std::map COLOR_MAP; 58 | 59 | std::string _outputXML; 60 | std::string _rawString; 61 | int _maxFontSize; 62 | std::stack _addFontEndFlags; 63 | }; 64 | 65 | NS_CCR_END 66 | -------------------------------------------------------------------------------- /creator_project/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "cocos-creator-js", 3 | "packages": "packages" 4 | } -------------------------------------------------------------------------------- /creator_project/settings/creator-luacpp-support.json: -------------------------------------------------------------------------------- 1 | { 2 | "autoBuild": false, 3 | "exportResourceDynamicallyLoaded": false, 4 | "exportResourceOnly": false, 5 | "path": "", 6 | "setup": false 7 | } -------------------------------------------------------------------------------- /creator_project/settings/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "collision-matrix": [ 3 | [ 4 | true, 5 | false 6 | ], 7 | [ 8 | false, 9 | true 10 | ] 11 | ], 12 | "design-resolution-height": 640, 13 | "design-resolution-width": 960, 14 | "excluded-modules": [], 15 | "fit-height": true, 16 | "fit-width": false, 17 | "group-list": [ 18 | "default", 19 | "collider" 20 | ], 21 | "simulator-orientation": false, 22 | "simulator-resolution": { 23 | "height": 640, 24 | "width": 960 25 | }, 26 | "start-scene": "current", 27 | "use-customize-simulator": false, 28 | "use-project-simulator-setting": false, 29 | "cocos-analytics": { 30 | "enable": false, 31 | "appID": "13798", 32 | "appSecret": "959b3ac0037d0f3c2fdce94f8421a9b2" 33 | } 34 | } --------------------------------------------------------------------------------