Merge pull request #8658 from pipu/v3_pipu

V3 pipu
This commit is contained in:
minggo 2014-10-14 14:25:46 +08:00
commit 0ab3017094
98 changed files with 54608 additions and 623 deletions

View File

@ -220,6 +220,7 @@ add_subdirectory(external/Box2D)
add_subdirectory(external/unzip)
add_subdirectory(external/xxhash)
add_subdirectory(external/tinyxml2)
add_subdirectory(external/protobuf-lite)
endif()
# libcocos2d.a

View File

@ -1,4 +1,4 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
@ -15,12 +15,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\l
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocos2d", "..\cocos\scripting\lua-bindings\proj.win32\libluacocos2d.vcxproj", "{9F2D6CE6-C893-4400-B50C-6DB70CC2562F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{92D54E36-7916-48EF-A951-224DD3B25442}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
@ -65,25 +65,25 @@ Global
{9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Release|ARM.ActiveCfg = Release|Win32
{9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Release|Win32.ActiveCfg = Release|Win32
{9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Release|Win32.Build.0 = Release|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Debug|ARM.ActiveCfg = Debug|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Release|ARM.ActiveCfg = Release|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|ARM.ActiveCfg = Debug|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.ActiveCfg = Debug|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.Build.0 = Debug|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|ARM.ActiveCfg = Release|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.ActiveCfg = Release|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.Build.0 = Release|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Debug|ARM.ActiveCfg = Debug|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Release|ARM.ActiveCfg = Release|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{929480E7-23C0-4DF6-8456-096D71547116} = {92D54E36-7916-48EF-A951-224DD3B25442}
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE} = {92D54E36-7916-48EF-A951-224DD3B25442}
{929480E7-23C0-4DF6-8456-096D71547116} = {92D54E36-7916-48EF-A951-224DD3B25442}
EndGlobalSection
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}

View File

@ -347,8 +347,6 @@
15AE196F19AAD35700C27E9E /* CCActionTimelineCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 0634A4C8194B19E400E608AF /* CCActionTimelineCache.h */; };
15AE197019AAD35700C27E9E /* CCFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0634A4C9194B19E400E608AF /* CCFrame.cpp */; };
15AE197119AAD35700C27E9E /* CCFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 0634A4CA194B19E400E608AF /* CCFrame.h */; };
15AE197219AAD35700C27E9E /* CCNodeReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0634A4CB194B19E400E608AF /* CCNodeReader.cpp */; };
15AE197319AAD35700C27E9E /* CCNodeReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0634A4CC194B19E400E608AF /* CCNodeReader.h */; };
15AE197419AAD35700C27E9E /* CCTimeLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0634A4CD194B19E400E608AF /* CCTimeLine.cpp */; };
15AE197519AAD35700C27E9E /* CCTimeLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 0634A4CE194B19E400E608AF /* CCTimeLine.h */; };
15AE197619AAD35700C27E9E /* CCTimelineMacro.h in Headers */ = {isa = PBXBuildFile; fileRef = 0634A4CF194B19E400E608AF /* CCTimelineMacro.h */; };
@ -358,8 +356,6 @@
15AE197A19AAD35700C27E9E /* CCActionTimelineCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 0634A4C8194B19E400E608AF /* CCActionTimelineCache.h */; };
15AE197B19AAD35700C27E9E /* CCFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0634A4C9194B19E400E608AF /* CCFrame.cpp */; };
15AE197C19AAD35700C27E9E /* CCFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 0634A4CA194B19E400E608AF /* CCFrame.h */; };
15AE197D19AAD35700C27E9E /* CCNodeReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0634A4CB194B19E400E608AF /* CCNodeReader.cpp */; };
15AE197E19AAD35700C27E9E /* CCNodeReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0634A4CC194B19E400E608AF /* CCNodeReader.h */; };
15AE197F19AAD35700C27E9E /* CCTimeLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0634A4CD194B19E400E608AF /* CCTimeLine.cpp */; };
15AE198019AAD35700C27E9E /* CCTimeLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 0634A4CE194B19E400E608AF /* CCTimeLine.h */; };
15AE198119AAD35700C27E9E /* CCTimelineMacro.h in Headers */ = {isa = PBXBuildFile; fileRef = 0634A4CF194B19E400E608AF /* CCTimelineMacro.h */; };
@ -1265,6 +1261,106 @@
299CF1FC19A434BC00C378C1 /* ccRandom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 299CF1F919A434BC00C378C1 /* ccRandom.cpp */; };
299CF1FD19A434BC00C378C1 /* ccRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 299CF1FA19A434BC00C378C1 /* ccRandom.h */; };
299CF1FE19A434BC00C378C1 /* ccRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 299CF1FA19A434BC00C378C1 /* ccRandom.h */; };
3828C09519EB8ACA002AB57B /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C06719EB8AC9002AB57B /* config.h */; };
3828C09619EB8ACA002AB57B /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C06719EB8AC9002AB57B /* config.h */; };
3828C09719EB8ACA002AB57B /* extension_set.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C06819EB8AC9002AB57B /* extension_set.cc */; };
3828C09819EB8ACA002AB57B /* extension_set.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C06819EB8AC9002AB57B /* extension_set.cc */; };
3828C09919EB8ACA002AB57B /* extension_set.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C06919EB8AC9002AB57B /* extension_set.h */; };
3828C09A19EB8ACA002AB57B /* extension_set.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C06919EB8AC9002AB57B /* extension_set.h */; };
3828C09B19EB8ACA002AB57B /* generated_message_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C06A19EB8AC9002AB57B /* generated_message_util.cc */; };
3828C09C19EB8ACA002AB57B /* generated_message_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C06A19EB8AC9002AB57B /* generated_message_util.cc */; };
3828C09D19EB8ACA002AB57B /* generated_message_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C06B19EB8AC9002AB57B /* generated_message_util.h */; };
3828C09E19EB8ACA002AB57B /* generated_message_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C06B19EB8AC9002AB57B /* generated_message_util.h */; };
3828C09F19EB8ACA002AB57B /* coded_stream.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C06D19EB8AC9002AB57B /* coded_stream.cc */; };
3828C0A019EB8ACA002AB57B /* coded_stream.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C06D19EB8AC9002AB57B /* coded_stream.cc */; };
3828C0A119EB8ACA002AB57B /* coded_stream.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C06E19EB8AC9002AB57B /* coded_stream.h */; };
3828C0A219EB8ACA002AB57B /* coded_stream.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C06E19EB8AC9002AB57B /* coded_stream.h */; };
3828C0A319EB8ACA002AB57B /* coded_stream_inl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C06F19EB8AC9002AB57B /* coded_stream_inl.h */; };
3828C0A419EB8ACA002AB57B /* coded_stream_inl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C06F19EB8AC9002AB57B /* coded_stream_inl.h */; };
3828C0A519EB8ACA002AB57B /* zero_copy_stream.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C07019EB8AC9002AB57B /* zero_copy_stream.cc */; };
3828C0A619EB8ACA002AB57B /* zero_copy_stream.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C07019EB8AC9002AB57B /* zero_copy_stream.cc */; };
3828C0A719EB8ACA002AB57B /* zero_copy_stream.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07119EB8AC9002AB57B /* zero_copy_stream.h */; };
3828C0A819EB8ACA002AB57B /* zero_copy_stream.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07119EB8AC9002AB57B /* zero_copy_stream.h */; };
3828C0A919EB8ACA002AB57B /* zero_copy_stream_impl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C07219EB8AC9002AB57B /* zero_copy_stream_impl.cc */; };
3828C0AA19EB8ACA002AB57B /* zero_copy_stream_impl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C07219EB8AC9002AB57B /* zero_copy_stream_impl.cc */; };
3828C0AB19EB8ACA002AB57B /* zero_copy_stream_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07319EB8AC9002AB57B /* zero_copy_stream_impl.h */; };
3828C0AC19EB8ACA002AB57B /* zero_copy_stream_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07319EB8AC9002AB57B /* zero_copy_stream_impl.h */; };
3828C0AD19EB8ACA002AB57B /* zero_copy_stream_impl_lite.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C07419EB8AC9002AB57B /* zero_copy_stream_impl_lite.cc */; };
3828C0AE19EB8ACA002AB57B /* zero_copy_stream_impl_lite.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C07419EB8AC9002AB57B /* zero_copy_stream_impl_lite.cc */; };
3828C0AF19EB8ACA002AB57B /* zero_copy_stream_impl_lite.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07519EB8AC9002AB57B /* zero_copy_stream_impl_lite.h */; };
3828C0B019EB8ACA002AB57B /* zero_copy_stream_impl_lite.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07519EB8AC9002AB57B /* zero_copy_stream_impl_lite.h */; };
3828C0B119EB8ACA002AB57B /* message_lite.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C07619EB8AC9002AB57B /* message_lite.cc */; };
3828C0B219EB8ACA002AB57B /* message_lite.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C07619EB8AC9002AB57B /* message_lite.cc */; };
3828C0B319EB8ACA002AB57B /* message_lite.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07719EB8AC9002AB57B /* message_lite.h */; };
3828C0B419EB8ACA002AB57B /* message_lite.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07719EB8AC9002AB57B /* message_lite.h */; };
3828C0B519EB8ACA002AB57B /* repeated_field.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C07819EB8AC9002AB57B /* repeated_field.cc */; };
3828C0B619EB8ACA002AB57B /* repeated_field.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C07819EB8AC9002AB57B /* repeated_field.cc */; };
3828C0B719EB8ACA002AB57B /* repeated_field.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07919EB8AC9002AB57B /* repeated_field.h */; };
3828C0B819EB8ACA002AB57B /* repeated_field.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07919EB8AC9002AB57B /* repeated_field.h */; };
3828C0B919EB8ACA002AB57B /* atomicops.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07B19EB8AC9002AB57B /* atomicops.h */; };
3828C0BA19EB8ACA002AB57B /* atomicops.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07B19EB8AC9002AB57B /* atomicops.h */; };
3828C0BB19EB8ACA002AB57B /* atomicops_internals_arm_gcc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07C19EB8ACA002AB57B /* atomicops_internals_arm_gcc.h */; };
3828C0BC19EB8ACA002AB57B /* atomicops_internals_arm_gcc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07C19EB8ACA002AB57B /* atomicops_internals_arm_gcc.h */; };
3828C0BD19EB8ACA002AB57B /* atomicops_internals_arm_qnx.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07D19EB8ACA002AB57B /* atomicops_internals_arm_qnx.h */; };
3828C0BE19EB8ACA002AB57B /* atomicops_internals_arm_qnx.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07D19EB8ACA002AB57B /* atomicops_internals_arm_qnx.h */; };
3828C0BF19EB8ACA002AB57B /* atomicops_internals_atomicword_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07E19EB8ACA002AB57B /* atomicops_internals_atomicword_compat.h */; };
3828C0C019EB8ACA002AB57B /* atomicops_internals_atomicword_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07E19EB8ACA002AB57B /* atomicops_internals_atomicword_compat.h */; };
3828C0C119EB8ACA002AB57B /* atomicops_internals_macosx.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07F19EB8ACA002AB57B /* atomicops_internals_macosx.h */; };
3828C0C219EB8ACA002AB57B /* atomicops_internals_macosx.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C07F19EB8ACA002AB57B /* atomicops_internals_macosx.h */; };
3828C0C319EB8ACA002AB57B /* atomicops_internals_mips_gcc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08019EB8ACA002AB57B /* atomicops_internals_mips_gcc.h */; };
3828C0C419EB8ACA002AB57B /* atomicops_internals_mips_gcc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08019EB8ACA002AB57B /* atomicops_internals_mips_gcc.h */; };
3828C0C519EB8ACA002AB57B /* atomicops_internals_pnacl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08119EB8ACA002AB57B /* atomicops_internals_pnacl.h */; };
3828C0C619EB8ACA002AB57B /* atomicops_internals_pnacl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08119EB8ACA002AB57B /* atomicops_internals_pnacl.h */; };
3828C0C719EB8ACA002AB57B /* atomicops_internals_x86_gcc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C08219EB8ACA002AB57B /* atomicops_internals_x86_gcc.cc */; };
3828C0C819EB8ACA002AB57B /* atomicops_internals_x86_gcc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C08219EB8ACA002AB57B /* atomicops_internals_x86_gcc.cc */; };
3828C0C919EB8ACA002AB57B /* atomicops_internals_x86_gcc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08319EB8ACA002AB57B /* atomicops_internals_x86_gcc.h */; };
3828C0CA19EB8ACA002AB57B /* atomicops_internals_x86_gcc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08319EB8ACA002AB57B /* atomicops_internals_x86_gcc.h */; };
3828C0CB19EB8ACA002AB57B /* atomicops_internals_x86_msvc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C08419EB8ACA002AB57B /* atomicops_internals_x86_msvc.cc */; };
3828C0CC19EB8ACA002AB57B /* atomicops_internals_x86_msvc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C08419EB8ACA002AB57B /* atomicops_internals_x86_msvc.cc */; };
3828C0CD19EB8ACA002AB57B /* atomicops_internals_x86_msvc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08519EB8ACA002AB57B /* atomicops_internals_x86_msvc.h */; };
3828C0CE19EB8ACA002AB57B /* atomicops_internals_x86_msvc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08519EB8ACA002AB57B /* atomicops_internals_x86_msvc.h */; };
3828C0CF19EB8ACA002AB57B /* common.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C08619EB8ACA002AB57B /* common.cc */; };
3828C0D019EB8ACA002AB57B /* common.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C08619EB8ACA002AB57B /* common.cc */; };
3828C0D119EB8ACA002AB57B /* common.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08719EB8ACA002AB57B /* common.h */; };
3828C0D219EB8ACA002AB57B /* common.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08719EB8ACA002AB57B /* common.h */; };
3828C0D319EB8ACA002AB57B /* hash.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08819EB8ACA002AB57B /* hash.h */; };
3828C0D419EB8ACA002AB57B /* hash.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08819EB8ACA002AB57B /* hash.h */; };
3828C0D519EB8ACA002AB57B /* map-util.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08919EB8ACA002AB57B /* map-util.h */; };
3828C0D619EB8ACA002AB57B /* map-util.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08919EB8ACA002AB57B /* map-util.h */; };
3828C0D719EB8ACA002AB57B /* once.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C08A19EB8ACA002AB57B /* once.cc */; };
3828C0D819EB8ACA002AB57B /* once.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C08A19EB8ACA002AB57B /* once.cc */; };
3828C0D919EB8ACA002AB57B /* once.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08B19EB8ACA002AB57B /* once.h */; };
3828C0DA19EB8ACA002AB57B /* once.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08B19EB8ACA002AB57B /* once.h */; };
3828C0DB19EB8ACA002AB57B /* platform_macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08C19EB8ACA002AB57B /* platform_macros.h */; };
3828C0DC19EB8ACA002AB57B /* platform_macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08C19EB8ACA002AB57B /* platform_macros.h */; };
3828C0DD19EB8ACA002AB57B /* stl_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08D19EB8ACA002AB57B /* stl_util.h */; };
3828C0DE19EB8ACA002AB57B /* stl_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08D19EB8ACA002AB57B /* stl_util.h */; };
3828C0DF19EB8ACA002AB57B /* stringprintf.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C08E19EB8ACA002AB57B /* stringprintf.cc */; };
3828C0E019EB8ACA002AB57B /* stringprintf.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C08E19EB8ACA002AB57B /* stringprintf.cc */; };
3828C0E119EB8ACA002AB57B /* stringprintf.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08F19EB8ACA002AB57B /* stringprintf.h */; };
3828C0E219EB8ACA002AB57B /* stringprintf.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C08F19EB8ACA002AB57B /* stringprintf.h */; };
3828C0E319EB8ACA002AB57B /* template_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C09019EB8ACA002AB57B /* template_util.h */; };
3828C0E419EB8ACA002AB57B /* template_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C09019EB8ACA002AB57B /* template_util.h */; };
3828C0E519EB8ACA002AB57B /* type_traits.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C09119EB8ACA002AB57B /* type_traits.h */; };
3828C0E619EB8ACA002AB57B /* type_traits.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C09119EB8ACA002AB57B /* type_traits.h */; };
3828C0E719EB8ACA002AB57B /* wire_format_lite_inl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C09219EB8ACA002AB57B /* wire_format_lite_inl.h */; };
3828C0E819EB8ACA002AB57B /* wire_format_lite_inl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C09219EB8ACA002AB57B /* wire_format_lite_inl.h */; };
3828C0E919EB8ACA002AB57B /* wire_format_lite.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C09319EB8ACA002AB57B /* wire_format_lite.cc */; };
3828C0EA19EB8ACA002AB57B /* wire_format_lite.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3828C09319EB8ACA002AB57B /* wire_format_lite.cc */; };
3828C0EB19EB8ACA002AB57B /* wire_format_lite.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C09419EB8ACA002AB57B /* wire_format_lite.h */; };
3828C0EC19EB8ACA002AB57B /* wire_format_lite.h in Headers */ = {isa = PBXBuildFile; fileRef = 3828C09419EB8ACA002AB57B /* wire_format_lite.h */; };
38B8E2CF19E65F4C002D7CE7 /* CSParseBinary.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 38B8E2CD19E65F4C002D7CE7 /* CSParseBinary.pb.cc */; };
38B8E2D019E65F4C002D7CE7 /* CSParseBinary.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 38B8E2CD19E65F4C002D7CE7 /* CSParseBinary.pb.cc */; };
38B8E2D119E65F4C002D7CE7 /* CSParseBinary.pb.h in Headers */ = {isa = PBXBuildFile; fileRef = 38B8E2CE19E65F4C002D7CE7 /* CSParseBinary.pb.h */; };
38B8E2D219E65F4C002D7CE7 /* CSParseBinary.pb.h in Headers */ = {isa = PBXBuildFile; fileRef = 38B8E2CE19E65F4C002D7CE7 /* CSParseBinary.pb.h */; };
38B8E2D519E66581002D7CE7 /* CSLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38B8E2D319E66581002D7CE7 /* CSLoader.cpp */; };
38B8E2D619E66581002D7CE7 /* CSLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38B8E2D319E66581002D7CE7 /* CSLoader.cpp */; };
38B8E2D719E66581002D7CE7 /* CSLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 38B8E2D419E66581002D7CE7 /* CSLoader.h */; };
38B8E2D819E66581002D7CE7 /* CSLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 38B8E2D419E66581002D7CE7 /* CSLoader.h */; };
38B8E2E119E671D2002D7CE7 /* UILayoutComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38B8E2DF19E671D2002D7CE7 /* UILayoutComponent.cpp */; };
38B8E2E219E671D2002D7CE7 /* UILayoutComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38B8E2DF19E671D2002D7CE7 /* UILayoutComponent.cpp */; };
38B8E2E319E671D2002D7CE7 /* UILayoutComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 38B8E2E019E671D2002D7CE7 /* UILayoutComponent.h */; };
38B8E2E419E671D2002D7CE7 /* UILayoutComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 38B8E2E019E671D2002D7CE7 /* UILayoutComponent.h */; };
3E2BDADE19C030ED0055CDCD /* AudioEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E2BDADD19C030ED0055CDCD /* AudioEngine.h */; };
3E2BDAEC19C0436F0055CDCD /* AudioEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E2BDAEB19C0436F0055CDCD /* AudioEngine.cpp */; };
3E2F27A619CFBFE100E7C490 /* AudioEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E2BDAEB19C0436F0055CDCD /* AudioEngine.cpp */; };
@ -1830,8 +1926,6 @@
0634A4C8194B19E400E608AF /* CCActionTimelineCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionTimelineCache.h; sourceTree = "<group>"; };
0634A4C9194B19E400E608AF /* CCFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFrame.cpp; sourceTree = "<group>"; };
0634A4CA194B19E400E608AF /* CCFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFrame.h; sourceTree = "<group>"; };
0634A4CB194B19E400E608AF /* CCNodeReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCNodeReader.cpp; sourceTree = "<group>"; };
0634A4CC194B19E400E608AF /* CCNodeReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeReader.h; sourceTree = "<group>"; };
0634A4CD194B19E400E608AF /* CCTimeLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTimeLine.cpp; sourceTree = "<group>"; };
0634A4CE194B19E400E608AF /* CCTimeLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTimeLine.h; sourceTree = "<group>"; };
0634A4CF194B19E400E608AF /* CCTimelineMacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTimelineMacro.h; sourceTree = "<group>"; };
@ -2303,6 +2397,56 @@
37936A3C1869B76800E974DD /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = "<group>"; };
37936A3D1869B76800E974DD /* stringbuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stringbuffer.h; sourceTree = "<group>"; };
37936A3E1869B76800E974DD /* writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = writer.h; sourceTree = "<group>"; };
3828C06719EB8AC9002AB57B /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = config.h; path = src/google/protobuf/config.h; sourceTree = "<group>"; };
3828C06819EB8AC9002AB57B /* extension_set.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = extension_set.cc; path = src/google/protobuf/extension_set.cc; sourceTree = "<group>"; };
3828C06919EB8AC9002AB57B /* extension_set.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = extension_set.h; path = src/google/protobuf/extension_set.h; sourceTree = "<group>"; };
3828C06A19EB8AC9002AB57B /* generated_message_util.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = generated_message_util.cc; path = src/google/protobuf/generated_message_util.cc; sourceTree = "<group>"; };
3828C06B19EB8AC9002AB57B /* generated_message_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = generated_message_util.h; path = src/google/protobuf/generated_message_util.h; sourceTree = "<group>"; };
3828C06D19EB8AC9002AB57B /* coded_stream.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coded_stream.cc; sourceTree = "<group>"; };
3828C06E19EB8AC9002AB57B /* coded_stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = coded_stream.h; sourceTree = "<group>"; };
3828C06F19EB8AC9002AB57B /* coded_stream_inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = coded_stream_inl.h; sourceTree = "<group>"; };
3828C07019EB8AC9002AB57B /* zero_copy_stream.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = zero_copy_stream.cc; sourceTree = "<group>"; };
3828C07119EB8AC9002AB57B /* zero_copy_stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zero_copy_stream.h; sourceTree = "<group>"; };
3828C07219EB8AC9002AB57B /* zero_copy_stream_impl.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = zero_copy_stream_impl.cc; sourceTree = "<group>"; };
3828C07319EB8AC9002AB57B /* zero_copy_stream_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zero_copy_stream_impl.h; sourceTree = "<group>"; };
3828C07419EB8AC9002AB57B /* zero_copy_stream_impl_lite.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = zero_copy_stream_impl_lite.cc; sourceTree = "<group>"; };
3828C07519EB8AC9002AB57B /* zero_copy_stream_impl_lite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zero_copy_stream_impl_lite.h; sourceTree = "<group>"; };
3828C07619EB8AC9002AB57B /* message_lite.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = message_lite.cc; path = src/google/protobuf/message_lite.cc; sourceTree = "<group>"; };
3828C07719EB8AC9002AB57B /* message_lite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = message_lite.h; path = src/google/protobuf/message_lite.h; sourceTree = "<group>"; };
3828C07819EB8AC9002AB57B /* repeated_field.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = repeated_field.cc; path = src/google/protobuf/repeated_field.cc; sourceTree = "<group>"; };
3828C07919EB8AC9002AB57B /* repeated_field.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = repeated_field.h; path = src/google/protobuf/repeated_field.h; sourceTree = "<group>"; };
3828C07B19EB8AC9002AB57B /* atomicops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomicops.h; sourceTree = "<group>"; };
3828C07C19EB8ACA002AB57B /* atomicops_internals_arm_gcc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomicops_internals_arm_gcc.h; sourceTree = "<group>"; };
3828C07D19EB8ACA002AB57B /* atomicops_internals_arm_qnx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomicops_internals_arm_qnx.h; sourceTree = "<group>"; };
3828C07E19EB8ACA002AB57B /* atomicops_internals_atomicword_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomicops_internals_atomicword_compat.h; sourceTree = "<group>"; };
3828C07F19EB8ACA002AB57B /* atomicops_internals_macosx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomicops_internals_macosx.h; sourceTree = "<group>"; };
3828C08019EB8ACA002AB57B /* atomicops_internals_mips_gcc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomicops_internals_mips_gcc.h; sourceTree = "<group>"; };
3828C08119EB8ACA002AB57B /* atomicops_internals_pnacl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomicops_internals_pnacl.h; sourceTree = "<group>"; };
3828C08219EB8ACA002AB57B /* atomicops_internals_x86_gcc.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = atomicops_internals_x86_gcc.cc; sourceTree = "<group>"; };
3828C08319EB8ACA002AB57B /* atomicops_internals_x86_gcc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomicops_internals_x86_gcc.h; sourceTree = "<group>"; };
3828C08419EB8ACA002AB57B /* atomicops_internals_x86_msvc.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = atomicops_internals_x86_msvc.cc; sourceTree = "<group>"; };
3828C08519EB8ACA002AB57B /* atomicops_internals_x86_msvc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomicops_internals_x86_msvc.h; sourceTree = "<group>"; };
3828C08619EB8ACA002AB57B /* common.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = common.cc; sourceTree = "<group>"; };
3828C08719EB8ACA002AB57B /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
3828C08819EB8ACA002AB57B /* hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hash.h; sourceTree = "<group>"; };
3828C08919EB8ACA002AB57B /* map-util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "map-util.h"; sourceTree = "<group>"; };
3828C08A19EB8ACA002AB57B /* once.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = once.cc; sourceTree = "<group>"; };
3828C08B19EB8ACA002AB57B /* once.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = once.h; sourceTree = "<group>"; };
3828C08C19EB8ACA002AB57B /* platform_macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform_macros.h; sourceTree = "<group>"; };
3828C08D19EB8ACA002AB57B /* stl_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stl_util.h; sourceTree = "<group>"; };
3828C08E19EB8ACA002AB57B /* stringprintf.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stringprintf.cc; sourceTree = "<group>"; };
3828C08F19EB8ACA002AB57B /* stringprintf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stringprintf.h; sourceTree = "<group>"; };
3828C09019EB8ACA002AB57B /* template_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = template_util.h; sourceTree = "<group>"; };
3828C09119EB8ACA002AB57B /* type_traits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = type_traits.h; sourceTree = "<group>"; };
3828C09219EB8ACA002AB57B /* wire_format_lite_inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wire_format_lite_inl.h; path = src/google/protobuf/wire_format_lite_inl.h; sourceTree = "<group>"; };
3828C09319EB8ACA002AB57B /* wire_format_lite.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = wire_format_lite.cc; path = src/google/protobuf/wire_format_lite.cc; sourceTree = "<group>"; };
3828C09419EB8ACA002AB57B /* wire_format_lite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wire_format_lite.h; path = src/google/protobuf/wire_format_lite.h; sourceTree = "<group>"; };
38B8E2CD19E65F4C002D7CE7 /* CSParseBinary.pb.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSParseBinary.pb.cc; sourceTree = "<group>"; };
38B8E2CE19E65F4C002D7CE7 /* CSParseBinary.pb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSParseBinary.pb.h; sourceTree = "<group>"; };
38B8E2D319E66581002D7CE7 /* CSLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSLoader.cpp; sourceTree = "<group>"; };
38B8E2D419E66581002D7CE7 /* CSLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSLoader.h; sourceTree = "<group>"; };
38B8E2DF19E671D2002D7CE7 /* UILayoutComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILayoutComponent.cpp; sourceTree = "<group>"; };
38B8E2E019E671D2002D7CE7 /* UILayoutComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILayoutComponent.h; sourceTree = "<group>"; };
3E2BDADD19C030ED0055CDCD /* AudioEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioEngine.h; sourceTree = "<group>"; };
3E2BDAEB19C0436F0055CDCD /* AudioEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioEngine.cpp; sourceTree = "<group>"; };
3E6176551960F89B00DE83F5 /* CCController-iOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "CCController-iOS.mm"; path = "../base/CCController-iOS.mm"; sourceTree = "<group>"; };
@ -2857,14 +3001,14 @@
0634A4C4194B19E400E608AF /* ActionTimeline */ = {
isa = PBXGroup;
children = (
38B8E2D319E66581002D7CE7 /* CSLoader.cpp */,
38B8E2D419E66581002D7CE7 /* CSLoader.h */,
0634A4C5194B19E400E608AF /* CCActionTimeline.cpp */,
0634A4C6194B19E400E608AF /* CCActionTimeline.h */,
0634A4C7194B19E400E608AF /* CCActionTimelineCache.cpp */,
0634A4C8194B19E400E608AF /* CCActionTimelineCache.h */,
0634A4C9194B19E400E608AF /* CCFrame.cpp */,
0634A4CA194B19E400E608AF /* CCFrame.h */,
0634A4CB194B19E400E608AF /* CCNodeReader.cpp */,
0634A4CC194B19E400E608AF /* CCNodeReader.h */,
0634A4CD194B19E400E608AF /* CCTimeLine.cpp */,
0634A4CE194B19E400E608AF /* CCTimeLine.h */,
0634A4CF194B19E400E608AF /* CCTimelineMacro.h */,
@ -3306,6 +3450,7 @@
1A57033E180BD0490088DEC7 /* external */ = {
isa = PBXGroup;
children = (
3828BFD819EB8AAD002AB57B /* protobuf-lite */,
1AC026971914068200FA920D /* ConvertUTF */,
46C02E0418E91123004B7456 /* xxhash */,
46A168B21807AF9C005B8026 /* Box2D */,
@ -3544,6 +3689,8 @@
1A8C5946180E930E00EF57C3 /* cocostudio */ = {
isa = PBXGroup;
children = (
38B8E2CD19E65F4C002D7CE7 /* CSParseBinary.pb.cc */,
38B8E2CE19E65F4C002D7CE7 /* CSParseBinary.pb.h */,
29E99D1C1957BA7000046604 /* CocoLoader.cpp */,
29E99D1D1957BA7000046604 /* CocoLoader.h */,
0634A4C4194B19E400E608AF /* ActionTimeline */,
@ -3963,6 +4110,8 @@
29CB8F511929D64500C841D6 /* base */ = {
isa = PBXGroup;
children = (
38B8E2DF19E671D2002D7CE7 /* UILayoutComponent.cpp */,
38B8E2E019E671D2002D7CE7 /* UILayoutComponent.h */,
2958244919873D8E00F9746D /* UIScale9Sprite.cpp */,
2958244A19873D8E00F9746D /* UIScale9Sprite.h */,
29080DEB191B82CE0066F8DF /* UIDeprecated.h */,
@ -4033,6 +4182,76 @@
path = internal;
sourceTree = "<group>";
};
3828BFD819EB8AAD002AB57B /* protobuf-lite */ = {
isa = PBXGroup;
children = (
3828C06719EB8AC9002AB57B /* config.h */,
3828C06819EB8AC9002AB57B /* extension_set.cc */,
3828C06919EB8AC9002AB57B /* extension_set.h */,
3828C06A19EB8AC9002AB57B /* generated_message_util.cc */,
3828C06B19EB8AC9002AB57B /* generated_message_util.h */,
3828C06C19EB8AC9002AB57B /* io */,
3828C07619EB8AC9002AB57B /* message_lite.cc */,
3828C07719EB8AC9002AB57B /* message_lite.h */,
3828C07819EB8AC9002AB57B /* repeated_field.cc */,
3828C07919EB8AC9002AB57B /* repeated_field.h */,
3828C07A19EB8AC9002AB57B /* stubs */,
3828C09219EB8ACA002AB57B /* wire_format_lite_inl.h */,
3828C09319EB8ACA002AB57B /* wire_format_lite.cc */,
3828C09419EB8ACA002AB57B /* wire_format_lite.h */,
);
name = "protobuf-lite";
path = "../external/protobuf-lite";
sourceTree = "<group>";
};
3828C06C19EB8AC9002AB57B /* io */ = {
isa = PBXGroup;
children = (
3828C06D19EB8AC9002AB57B /* coded_stream.cc */,
3828C06E19EB8AC9002AB57B /* coded_stream.h */,
3828C06F19EB8AC9002AB57B /* coded_stream_inl.h */,
3828C07019EB8AC9002AB57B /* zero_copy_stream.cc */,
3828C07119EB8AC9002AB57B /* zero_copy_stream.h */,
3828C07219EB8AC9002AB57B /* zero_copy_stream_impl.cc */,
3828C07319EB8AC9002AB57B /* zero_copy_stream_impl.h */,
3828C07419EB8AC9002AB57B /* zero_copy_stream_impl_lite.cc */,
3828C07519EB8AC9002AB57B /* zero_copy_stream_impl_lite.h */,
);
name = io;
path = src/google/protobuf/io;
sourceTree = "<group>";
};
3828C07A19EB8AC9002AB57B /* stubs */ = {
isa = PBXGroup;
children = (
3828C07B19EB8AC9002AB57B /* atomicops.h */,
3828C07C19EB8ACA002AB57B /* atomicops_internals_arm_gcc.h */,
3828C07D19EB8ACA002AB57B /* atomicops_internals_arm_qnx.h */,
3828C07E19EB8ACA002AB57B /* atomicops_internals_atomicword_compat.h */,
3828C07F19EB8ACA002AB57B /* atomicops_internals_macosx.h */,
3828C08019EB8ACA002AB57B /* atomicops_internals_mips_gcc.h */,
3828C08119EB8ACA002AB57B /* atomicops_internals_pnacl.h */,
3828C08219EB8ACA002AB57B /* atomicops_internals_x86_gcc.cc */,
3828C08319EB8ACA002AB57B /* atomicops_internals_x86_gcc.h */,
3828C08419EB8ACA002AB57B /* atomicops_internals_x86_msvc.cc */,
3828C08519EB8ACA002AB57B /* atomicops_internals_x86_msvc.h */,
3828C08619EB8ACA002AB57B /* common.cc */,
3828C08719EB8ACA002AB57B /* common.h */,
3828C08819EB8ACA002AB57B /* hash.h */,
3828C08919EB8ACA002AB57B /* map-util.h */,
3828C08A19EB8ACA002AB57B /* once.cc */,
3828C08B19EB8ACA002AB57B /* once.h */,
3828C08C19EB8ACA002AB57B /* platform_macros.h */,
3828C08D19EB8ACA002AB57B /* stl_util.h */,
3828C08E19EB8ACA002AB57B /* stringprintf.cc */,
3828C08F19EB8ACA002AB57B /* stringprintf.h */,
3828C09019EB8ACA002AB57B /* template_util.h */,
3828C09119EB8ACA002AB57B /* type_traits.h */,
);
name = stubs;
path = src/google/protobuf/stubs;
sourceTree = "<group>";
};
46A15FD01807A56F005B8026 /* audio */ = {
isa = PBXGroup;
children = (
@ -4819,6 +5038,7 @@
50ABBE9B1925AB6F00A911A9 /* CCRef.h in Headers */,
50ABBE851925AB6F00A911A9 /* ccFPSImages.h in Headers */,
15AE1A5319AAD40300C27E9E /* b2Draw.h in Headers */,
38B8E2E319E671D2002D7CE7 /* UILayoutComponent.h in Headers */,
5034CA39191D591100CE6051 /* ccShader_PositionColorLengthTexture.frag in Headers */,
292DB14B19B4574100A80320 /* UIEditBoxImpl-mac.h in Headers */,
3EA1073119D7F37700CAB794 /* CCLight.h in Headers */,
@ -4832,6 +5052,7 @@
15AE18FC19AAD35000C27E9E /* CCComBase.h in Headers */,
1ABA68B01888D700007D1BB4 /* CCFontCharMap.h in Headers */,
15AE1B5219AADA9900C27E9E /* UIPageView.h in Headers */,
3828C0A719EB8ACA002AB57B /* zero_copy_stream.h in Headers */,
5091A7A319BFABA800AC8789 /* CCPlatformDefine.h in Headers */,
5034CA3F191D591100CE6051 /* ccShader_Position_uColor.vert in Headers */,
50ABBD461925AB0000A911A9 /* CCVertex.h in Headers */,
@ -4839,6 +5060,7 @@
46A170E71807CECA005B8026 /* CCPhysicsBody.h in Headers */,
15AE1A5A19AAD40300C27E9E /* b2StackAllocator.h in Headers */,
15AE1B6F19AADA9900C27E9E /* GUIDefine.h in Headers */,
3828C0E519EB8ACA002AB57B /* type_traits.h in Headers */,
15AE1A8119AAD40300C27E9E /* b2FrictionJoint.h in Headers */,
15AE18DD19AAD35000C27E9E /* CocoLoader.h in Headers */,
46A170EB1807CECA005B8026 /* CCPhysicsJoint.h in Headers */,
@ -4892,6 +5114,7 @@
15AE182A19AAD2F700C27E9E /* CCMeshSkin.h in Headers */,
B276EF5F1988D1D500CD400F /* CCVertexIndexData.h in Headers */,
1A57007F180BC5A10088DEC7 /* CCActionInterval.h in Headers */,
3828C0DB19EB8ACA002AB57B /* platform_macros.h in Headers */,
15AE1A7F19AAD40300C27E9E /* b2DistanceJoint.h in Headers */,
15AE188719AAD33D00C27E9E /* CCBSequenceProperty.h in Headers */,
1A01C69A18F57BE800EFE3A6 /* CCSet.h in Headers */,
@ -4899,6 +5122,7 @@
1A570087180BC5A10088DEC7 /* CCActionPageTurn3D.h in Headers */,
50ABBD911925AB4100A911A9 /* CCGLProgramCache.h in Headers */,
50ED2BDA19BE76D300A0AB90 /* UIVideoPlayer.h in Headers */,
3828C0CD19EB8ACA002AB57B /* atomicops_internals_x86_msvc.h in Headers */,
15AE199919AAD39600C27E9E /* LoadingBarReader.h in Headers */,
15AE1A8F19AAD40300C27E9E /* b2RopeJoint.h in Headers */,
15AE18ED19AAD35000C27E9E /* CCActionObject.h in Headers */,
@ -4907,6 +5131,7 @@
15AE184819AAD2F700C27E9E /* cocos3d.h in Headers */,
50ABBEC31925AB6F00A911A9 /* CCVector.h in Headers */,
1A57008B180BC5A10088DEC7 /* CCActionProgressTimer.h in Headers */,
3828C0EB19EB8ACA002AB57B /* wire_format_lite.h in Headers */,
50ABBD8D1925AB4100A911A9 /* CCGLProgram.h in Headers */,
50ABBEA11925AB6F00A911A9 /* CCScheduler.h in Headers */,
15AE1B6219AADA9900C27E9E /* UIButton.h in Headers */,
@ -4924,6 +5149,7 @@
15AE190819AAD35000C27E9E /* CCDatas.h in Headers */,
1A5700A0180BC5D20088DEC7 /* CCNode.h in Headers */,
50ABC0671926664800A911A9 /* CCPlatformDefine-mac.h in Headers */,
3828C0C319EB8ACA002AB57B /* atomicops_internals_mips_gcc.h in Headers */,
15AE189A19AAD33D00C27E9E /* CCMenuLoader.h in Headers */,
46C02E0918E91123004B7456 /* xxhash.h in Headers */,
15AE1A6B19AAD40300C27E9E /* b2ChainAndCircleContact.h in Headers */,
@ -4939,6 +5165,7 @@
15AE1B6819AADA9900C27E9E /* UIScale9Sprite.h in Headers */,
1A570121180BC90D0088DEC7 /* CCGrid.h in Headers */,
5034CA2D191D591100CE6051 /* ccShader_PositionTextureA8Color.frag in Headers */,
3828C0A319EB8ACA002AB57B /* coded_stream_inl.h in Headers */,
1AC0269C1914068200FA920D /* ConvertUTF.h in Headers */,
15AE1A7119AAD40300C27E9E /* b2Contact.h in Headers */,
50ABBED11925AB6F00A911A9 /* TGAlib.h in Headers */,
@ -4958,6 +5185,7 @@
15AE18A119AAD33D00C27E9E /* CCNodeLoaderListener.h in Headers */,
5034CA47191D591100CE6051 /* ccShader_Label_normal.frag in Headers */,
15AE182219AAD2F700C27E9E /* CCBundleReader.h in Headers */,
3828C0E319EB8ACA002AB57B /* template_util.h in Headers */,
15AE18A519AAD33D00C27E9E /* CCScale9SpriteLoader.h in Headers */,
50ED2BE019BEAF7900A0AB90 /* UIEditBoxImpl-win32.h in Headers */,
15AE197119AAD35700C27E9E /* CCFrame.h in Headers */,
@ -4980,6 +5208,7 @@
1A5701C9180BCB5A0088DEC7 /* CCLabelTextFormatter.h in Headers */,
5034CA37191D591100CE6051 /* ccShader_PositionColorLengthTexture.vert in Headers */,
15AE1B6419AADA9900C27E9E /* UICheckBox.h in Headers */,
3828C0AB19EB8ACA002AB57B /* zero_copy_stream_impl.h in Headers */,
1A5701CD180BCB5A0088DEC7 /* CCLabelTTF.h in Headers */,
15AE1A3319AAD3D500C27E9E /* b2CircleShape.h in Headers */,
1A5701E0180BCB8C0088DEC7 /* CCLayer.h in Headers */,
@ -4991,6 +5220,7 @@
50ABBEAD1925AB6F00A911A9 /* ccTypes.h in Headers */,
1A087AEA1860400400196EF5 /* edtaa3func.h in Headers */,
15AE181C19AAD2F700C27E9E /* CCBundle3D.h in Headers */,
3828C0E119EB8ACA002AB57B /* stringprintf.h in Headers */,
15AE189919AAD33D00C27E9E /* CCMenuItemLoader.h in Headers */,
15AE1B5E19AADA9900C27E9E /* UITextBMFont.h in Headers */,
15AE18E719AAD35000C27E9E /* CCActionFrameEasing.h in Headers */,
@ -5007,6 +5237,7 @@
1A570204180BCBD40088DEC7 /* CCClippingNode.h in Headers */,
15AE1A7B19AAD40300C27E9E /* b2PolygonContact.h in Headers */,
15AE1A2919AAD3D500C27E9E /* b2Collision.h in Headers */,
38B8E2D719E66581002D7CE7 /* CSLoader.h in Headers */,
50643BE419BFCF1800EF68ED /* CCPlatformMacros.h in Headers */,
15AE184219AAD2F700C27E9E /* CCSprite3D.h in Headers */,
15AE18A019AAD33D00C27E9E /* CCNodeLoaderLibrary.h in Headers */,
@ -5021,9 +5252,11 @@
15AE1A8319AAD40300C27E9E /* b2GearJoint.h in Headers */,
15AE1BD519AAE01E00C27E9E /* CCControlSaturationBrightnessPicker.h in Headers */,
15AE186919AAD31D00C27E9E /* CocosDenshion.h in Headers */,
3828C0D319EB8ACA002AB57B /* hash.h in Headers */,
50ABBD891925AB4100A911A9 /* CCCustomCommand.h in Headers */,
15AE1A8719AAD40300C27E9E /* b2MouseJoint.h in Headers */,
5034CA43191D591100CE6051 /* ccShader_Label.vert in Headers */,
3828C0A119EB8ACA002AB57B /* coded_stream.h in Headers */,
15AE189719AAD33D00C27E9E /* CCMenuItemImageLoader.h in Headers */,
15AE189319AAD33D00C27E9E /* CCLayerGradientLoader.h in Headers */,
15AE18EF19AAD35000C27E9E /* CCArmature.h in Headers */,
@ -5033,6 +5266,7 @@
15AE190E19AAD35000C27E9E /* CCDisplayManager.h in Headers */,
15AE1A6719AAD40300C27E9E /* b2World.h in Headers */,
15AE19D119AAD3A700C27E9E /* AttachmentLoader.h in Headers */,
3828C0B919EB8ACA002AB57B /* atomicops.h in Headers */,
15AE199B19AAD39600C27E9E /* PageViewReader.h in Headers */,
15AE1A6219AAD40300C27E9E /* b2Fixture.h in Headers */,
15AE191C19AAD35000C27E9E /* CCTransformHelp.h in Headers */,
@ -5046,7 +5280,10 @@
15AE18F119AAD35000C27E9E /* CCArmatureAnimation.h in Headers */,
1A57022F180BCC1A0088DEC7 /* CCParticleSystemQuad.h in Headers */,
15AE188519AAD33D00C27E9E /* CCBSequence.h in Headers */,
3828C0C519EB8ACA002AB57B /* atomicops_internals_pnacl.h in Headers */,
3828C0D519EB8ACA002AB57B /* map-util.h in Headers */,
50643BE219BFCF1800EF68ED /* CCPlatformConfig.h in Headers */,
3828C0D119EB8ACA002AB57B /* common.h in Headers */,
5034CA49191D591100CE6051 /* ccShader_Label_df.frag in Headers */,
292DB14119B4574100A80320 /* UIEditBoxImpl.h in Headers */,
50CB247919D9C5A100687767 /* AudioEngine-inl.h in Headers */,
@ -5075,10 +5312,12 @@
15AE1BA019AADFDF00C27E9E /* UILayout.h in Headers */,
1A570294180BCCAB0088DEC7 /* CCAnimation.h in Headers */,
50ABBD421925AB0000A911A9 /* CCMathBase.h in Headers */,
3828C0BB19EB8ACA002AB57B /* atomicops_internals_arm_gcc.h in Headers */,
1A570298180BCCAB0088DEC7 /* CCAnimationCache.h in Headers */,
50ABC05D1926664800A911A9 /* CCApplication-mac.h in Headers */,
15AE190019AAD35000C27E9E /* CCComAudio.h in Headers */,
15AE190419AAD35000C27E9E /* CCComRender.h in Headers */,
3828C09519EB8ACA002AB57B /* config.h in Headers */,
15AE18AA19AAD33D00C27E9E /* CocosBuilder.h in Headers */,
50ABC0071926664800A911A9 /* CCApplicationProtocol.h in Headers */,
15AE1A7919AAD40300C27E9E /* b2PolygonAndCircleContact.h in Headers */,
@ -5093,6 +5332,7 @@
1A12775B18DFCC540005F345 /* CCTweenFunction.h in Headers */,
1A5702CA180BCE370088DEC7 /* CCTextFieldTTF.h in Headers */,
15AE19E519AAD3A700C27E9E /* SkeletonJson.h in Headers */,
3828C0B319EB8ACA002AB57B /* message_lite.h in Headers */,
15EFA213198A2BB5000C57D3 /* CCProtectedNode.h in Headers */,
1A5702EC180BCE750088DEC7 /* CCTileMapAtlas.h in Headers */,
15AE18E019AAD35000C27E9E /* TriggerBase.h in Headers */,
@ -5127,6 +5367,7 @@
15AE19BD19AAD3A700C27E9E /* SkeletonBounds.h in Headers */,
15AE1B7119AADA9900C27E9E /* CocosGUI.h in Headers */,
15AE1A2D19AAD3D500C27E9E /* b2DynamicTree.h in Headers */,
3828C09D19EB8ACA002AB57B /* generated_message_util.h in Headers */,
50ABBD851925AB4100A911A9 /* CCBatchCommand.h in Headers */,
15AE1A6F19AAD40300C27E9E /* b2CircleContact.h in Headers */,
15AE191619AAD35000C27E9E /* CCSkin.h in Headers */,
@ -5135,6 +5376,7 @@
15AE190C19AAD35000C27E9E /* CCDisplayFactory.h in Headers */,
B37510751823AC9F00B3BA6A /* CCPhysicsHelper_chipmunk.h in Headers */,
15AE1A8B19AAD40300C27E9E /* b2PulleyJoint.h in Headers */,
38B8E2D119E65F4C002D7CE7 /* CSParseBinary.pb.h in Headers */,
15AE1A5119AAD40300C27E9E /* b2BlockAllocator.h in Headers */,
15AE19C719AAD3A700C27E9E /* AnimationState.h in Headers */,
15AE199119AAD37200C27E9E /* ImageViewReader.h in Headers */,
@ -5162,6 +5404,7 @@
15AE1BCA19AAE01E00C27E9E /* CCControl.h in Headers */,
50ABBDBF1925AB4100A911A9 /* CCTextureCache.h in Headers */,
15AE186719AAD31D00C27E9E /* CDXMacOSXSupport.h in Headers */,
3828C0BF19EB8ACA002AB57B /* atomicops_internals_atomicword_compat.h in Headers */,
B37510741823AC9F00B3BA6A /* CCPhysicsContactInfo_chipmunk.h in Headers */,
5034CA35191D591100CE6051 /* ccShader_PositionTexture.frag in Headers */,
15AE1BB219AADFEF00C27E9E /* HttpClient.h in Headers */,
@ -5190,7 +5433,6 @@
B257B4501989D5E800D9A687 /* CCPrimitive.h in Headers */,
50ABBE6B1925AB6F00A911A9 /* CCEventListenerFocus.h in Headers */,
50ABBDA51925AB4100A911A9 /* CCQuadCommand.h in Headers */,
15AE197319AAD35700C27E9E /* CCNodeReader.h in Headers */,
15AE1BCF19AAE01E00C27E9E /* CCControlExtensions.h in Headers */,
15AE1A3519AAD3D500C27E9E /* b2EdgeShape.h in Headers */,
50643BD919BFAF4400EF68ED /* CCApplication.h in Headers */,
@ -5200,6 +5442,7 @@
50ABBD3A1925AB0000A911A9 /* CCAffineTransform.h in Headers */,
15AE186C19AAD31D00C27E9E /* SimpleAudioEngine_objc.h in Headers */,
15AE1BB319AADFEF00C27E9E /* HttpRequest.h in Headers */,
3828C0C119EB8ACA002AB57B /* atomicops_internals_macosx.h in Headers */,
50ABBE571925AB6F00A911A9 /* CCEventFocus.h in Headers */,
1A01C69218F57BE800EFE3A6 /* CCDouble.h in Headers */,
15AE18F919AAD35000C27E9E /* CCBone.h in Headers */,
@ -5219,6 +5462,7 @@
15AE19A119AAD39600C27E9E /* TextAtlasReader.h in Headers */,
50ABC0231926664800A911A9 /* CCGLViewImpl-desktop.h in Headers */,
15AE188D19AAD33D00C27E9E /* CCLabelBMFontLoader.h in Headers */,
3828C0DD19EB8ACA002AB57B /* stl_util.h in Headers */,
15AE1B5019AADA9900C27E9E /* UILoadingBar.h in Headers */,
50ABBFFD1926664800A911A9 /* CCFileUtils-apple.h in Headers */,
5034CA41191D591100CE6051 /* ccShader_Position_uColor.frag in Headers */,
@ -5226,6 +5470,7 @@
50ABBE5B1925AB6F00A911A9 /* CCEventKeyboard.h in Headers */,
1A01C69E18F57BE800EFE3A6 /* CCString.h in Headers */,
50ABC00F1926664800A911A9 /* CCFileUtils.h in Headers */,
3828C0B719EB8ACA002AB57B /* repeated_field.h in Headers */,
15AE1A3719AAD3D500C27E9E /* b2PolygonShape.h in Headers */,
15AE1B5419AADA9900C27E9E /* UIRichText.h in Headers */,
50ABBE3B1925AB6F00A911A9 /* CCData.h in Headers */,
@ -5238,11 +5483,14 @@
15AE191A19AAD35000C27E9E /* CCSSceneReader.h in Headers */,
292DB13F19B4574100A80320 /* UIEditBox.h in Headers */,
50ABBE671925AB6F00A911A9 /* CCEventListenerCustom.h in Headers */,
3828C0D919EB8ACA002AB57B /* once.h in Headers */,
15AE18E219AAD35000C27E9E /* TriggerMng.h in Headers */,
15AE19ED19AAD3A700C27E9E /* spine-cocos2dx.h in Headers */,
50ABBE2F1925AB6F00A911A9 /* ccConfig.h in Headers */,
15AE188019AAD33D00C27E9E /* CCBMemberVariableAssigner.h in Headers */,
3828C09919EB8ACA002AB57B /* extension_set.h in Headers */,
1AAF5851180E40B9000584C8 /* LocalStorage.h in Headers */,
3828C0BD19EB8ACA002AB57B /* atomicops_internals_arm_qnx.h in Headers */,
15AE19CB19AAD3A700C27E9E /* Atlas.h in Headers */,
1A01C69018F57BE800EFE3A6 /* CCDictionary.h in Headers */,
1A9DCA29180E6955007A3AD4 /* CCGLBufferedNode.h in Headers */,
@ -5261,9 +5509,11 @@
B29594B61926D5EC003EEF37 /* CCMeshCommand.h in Headers */,
15AE19E319AAD3A700C27E9E /* SkeletonData.h in Headers */,
50ABBE371925AB6F00A911A9 /* CCConsole.h in Headers */,
3828C0E719EB8ACA002AB57B /* wire_format_lite_inl.h in Headers */,
50ABC00B1926664800A911A9 /* CCDevice.h in Headers */,
50ABC0131926664800A911A9 /* CCGLView.h in Headers */,
15AE189C19AAD33D00C27E9E /* CCNode+CCBRelativePositioning.h in Headers */,
3828C0C919EB8ACA002AB57B /* atomicops_internals_x86_gcc.h in Headers */,
15AE190A19AAD35000C27E9E /* CCDecorativeDisplay.h in Headers */,
50ABBDB31925AB4100A911A9 /* ccShaders.h in Headers */,
50ABBDAB1925AB4100A911A9 /* CCRenderCommandPool.h in Headers */,
@ -5292,6 +5542,7 @@
15AE19BF19AAD3A700C27E9E /* Event.h in Headers */,
50ABBE531925AB6F00A911A9 /* CCEventDispatcher.h in Headers */,
464AD6E7197EBB1400E502D8 /* pvr.h in Headers */,
3828C0AF19EB8ACA002AB57B /* zero_copy_stream_impl_lite.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -5299,7 +5550,6 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
15AE197E19AAD35700C27E9E /* CCNodeReader.h in Headers */,
503DD8F01926736A00CD74DD /* CCStdC-ios.h in Headers */,
15AE1A9A19AAD40300C27E9E /* b2Math.h in Headers */,
46A170FF1807CECB005B8026 /* CCPhysicsContact.h in Headers */,
@ -5310,6 +5560,7 @@
50643BDA19BFAF4400EF68ED /* CCApplication.h in Headers */,
15AE181519AAD2F700C27E9E /* CCAnimationCurve.h in Headers */,
503DD8EF1926736A00CD74DD /* CCPlatformDefine-ios.h in Headers */,
3828C0C019EB8ACA002AB57B /* atomicops_internals_atomicword_compat.h in Headers */,
15AE19F219AAD3A700C27E9E /* Event.h in Headers */,
15AE196919AAD35100C27E9E /* CocoStudio.h in Headers */,
46A171041807CECB005B8026 /* CCPhysicsShape.h in Headers */,
@ -5327,6 +5578,7 @@
292DB16219B461CA00A80320 /* ExtensionDeprecated.h in Headers */,
50ABBD961925AB4100A911A9 /* CCGLProgramState.h in Headers */,
46A171061807CECB005B8026 /* CCPhysicsWorld.h in Headers */,
3828C0CA19EB8ACA002AB57B /* atomicops_internals_x86_gcc.h in Headers */,
50ABBDB41925AB4100A911A9 /* ccShaders.h in Headers */,
15AE19B319AAD39700C27E9E /* SliderReader.h in Headers */,
15AE1B7919AADA9A00C27E9E /* UIRichText.h in Headers */,
@ -5364,8 +5616,10 @@
15AE1ACD19AAD40300C27E9E /* b2PrismaticJoint.h in Headers */,
50ABBEBA1925AB6F00A911A9 /* ccUTF8.h in Headers */,
50643BD619BFAEDA00EF68ED /* CCPlatformDefine.h in Headers */,
3828C0B419EB8ACA002AB57B /* message_lite.h in Headers */,
15AE1A1219AAD3A700C27E9E /* RegionAttachment.h in Headers */,
1A570068180BC5A10088DEC7 /* CCActionCamera.h in Headers */,
3828C0BA19EB8ACA002AB57B /* atomicops.h in Headers */,
15AE18BC19AAD33D00C27E9E /* CCControlLoader.h in Headers */,
15AE18C019AAD33D00C27E9E /* CCLabelTTFLoader.h in Headers */,
1A57006C180BC5A10088DEC7 /* CCActionCatmullRom.h in Headers */,
@ -5375,8 +5629,10 @@
50ABBE501925AB6F00A911A9 /* CCEventCustom.h in Headers */,
15AE1AD719AAD40300C27E9E /* b2WheelJoint.h in Headers */,
1A570070180BC5A10088DEC7 /* CCActionEase.h in Headers */,
3828C09A19EB8ACA002AB57B /* extension_set.h in Headers */,
1A570074180BC5A10088DEC7 /* CCActionGrid.h in Headers */,
15AE194A19AAD35100C27E9E /* CCComController.h in Headers */,
3828C0A219EB8ACA002AB57B /* coded_stream.h in Headers */,
B37510841823ACA100B3BA6A /* CCPhysicsShapeInfo_chipmunk.h in Headers */,
5034CA46191D591100CE6051 /* ccShader_Label_outline.frag in Headers */,
1A570078180BC5A10088DEC7 /* CCActionGrid3D.h in Headers */,
@ -5385,20 +5641,25 @@
1A01C68918F57BE800EFE3A6 /* CCBool.h in Headers */,
15AE184319AAD2F700C27E9E /* CCSprite3D.h in Headers */,
50CB247E19D9C5A100687767 /* AudioPlayer.h in Headers */,
3828C0DA19EB8ACA002AB57B /* once.h in Headers */,
1A57007C180BC5A10088DEC7 /* CCActionInstant.h in Headers */,
3E6176751960F89B00DE83F5 /* CCEventController.h in Headers */,
15AE18CD19AAD33D00C27E9E /* CCNode+CCBRelativePositioning.h in Headers */,
15AE1A0219AAD3A700C27E9E /* Attachment.h in Headers */,
3828C0D619EB8ACA002AB57B /* map-util.h in Headers */,
50ABBE781925AB6F00A911A9 /* CCEventListenerTouch.h in Headers */,
B37510861823ACA100B3BA6A /* CCPhysicsWorldInfo_chipmunk.h in Headers */,
15AE1BC019AADFF000C27E9E /* WebSocket.h in Headers */,
3828C0DE19EB8ACA002AB57B /* stl_util.h in Headers */,
1A570080180BC5A10088DEC7 /* CCActionInterval.h in Headers */,
15AE192D19AAD35100C27E9E /* CCActionFrame.h in Headers */,
15AE192F19AAD35100C27E9E /* CCActionFrameEasing.h in Headers */,
3828C0A819EB8ACA002AB57B /* zero_copy_stream.h in Headers */,
1A570084180BC5A10088DEC7 /* CCActionManager.h in Headers */,
15AE18C619AAD33D00C27E9E /* CCLayerLoader.h in Headers */,
50ABC0141926664800A911A9 /* CCGLView.h in Headers */,
1A570088180BC5A10088DEC7 /* CCActionPageTurn3D.h in Headers */,
3828C0DC19EB8ACA002AB57B /* platform_macros.h in Headers */,
15AE1B9319AADA9A00C27E9E /* UIHelper.h in Headers */,
50ABBD9E1925AB4100A911A9 /* ccGLStateCache.h in Headers */,
15AE1B9619AADA9A00C27E9E /* CocosGUI.h in Headers */,
@ -5482,6 +5743,7 @@
1A5701C4180BCB5A0088DEC7 /* CCLabelBMFont.h in Headers */,
15AE193F19AAD35100C27E9E /* CCBatchNode.h in Headers */,
15AE1C1819AAE2C700C27E9E /* CCPhysicsSprite.h in Headers */,
3828C0B019EB8ACA002AB57B /* zero_copy_stream_impl_lite.h in Headers */,
15AE1BC819AAE00000C27E9E /* AssetsManager.h in Headers */,
15AE1BBC19AADFF000C27E9E /* HttpResponse.h in Headers */,
15AE186019AAD31200C27E9E /* SimpleAudioEngine_objc.h in Headers */,
@ -5503,18 +5765,22 @@
15AE19F419AAD3A700C27E9E /* EventData.h in Headers */,
15AE1BAA19AADFDF00C27E9E /* UIVBox.h in Headers */,
15AE194E19AAD35100C27E9E /* CCDataReaderHelper.h in Headers */,
3828C0A419EB8ACA002AB57B /* coded_stream_inl.h in Headers */,
15AE1ADB19AAD41000C27E9E /* b2Rope.h in Headers */,
1A5701CE180BCB5A0088DEC7 /* CCLabelTTF.h in Headers */,
15AE1AB119AAD40300C27E9E /* b2ChainAndPolygonContact.h in Headers */,
15AE1A1E19AAD3A700C27E9E /* SlotData.h in Headers */,
1A5701E1180BCB8C0088DEC7 /* CCLayer.h in Headers */,
15AE1BEE19AAE01E00C27E9E /* CCControlExtensions.h in Headers */,
3828C09619EB8ACA002AB57B /* config.h in Headers */,
1A5701E5180BCB8C0088DEC7 /* CCScene.h in Headers */,
1A5701E9180BCB8C0088DEC7 /* CCTransition.h in Headers */,
15AE198F19AAD36E00C27E9E /* CheckBoxReader.h in Headers */,
3828C0E419EB8ACA002AB57B /* template_util.h in Headers */,
50ABBED41925AB6F00A911A9 /* uthash.h in Headers */,
1A5701ED180BCB8C0088DEC7 /* CCTransitionPageTurn.h in Headers */,
1A5701F1180BCB8C0088DEC7 /* CCTransitionProgress.h in Headers */,
3828C0E819EB8ACA002AB57B /* wire_format_lite_inl.h in Headers */,
15AE1A9C19AAD40300C27E9E /* b2Settings.h in Headers */,
1A5701FA180BCBAD0088DEC7 /* CCMenu.h in Headers */,
15AE18BA19AAD33D00C27E9E /* CCControlButtonLoader.h in Headers */,
@ -5548,6 +5814,7 @@
1A57022C180BCC1A0088DEC7 /* CCParticleSystem.h in Headers */,
15AE1BAC19AADFDF00C27E9E /* UILayout.h in Headers */,
1A570230180BCC1A0088DEC7 /* CCParticleSystemQuad.h in Headers */,
3828C09E19EB8ACA002AB57B /* generated_message_util.h in Headers */,
29394CF119B01DBA00D2DE1A /* UIWebView.h in Headers */,
15AE18B419AAD33D00C27E9E /* CCBSelectorResolver.h in Headers */,
B24AA988195A675C007B4522 /* CCFastTMXLayer.h in Headers */,
@ -5560,6 +5827,8 @@
50ABBD431925AB0000A911A9 /* CCMathBase.h in Headers */,
15EFA214198A2BB5000C57D3 /* CCProtectedNode.h in Headers */,
15AE194419AAD35100C27E9E /* CCComBase.h in Headers */,
3828C0D219EB8ACA002AB57B /* common.h in Headers */,
3828C0C219EB8ACA002AB57B /* atomicops_internals_macosx.h in Headers */,
15AE1A3B19AAD3D500C27E9E /* b2BroadPhase.h in Headers */,
15AE195619AAD35100C27E9E /* CCDisplayManager.h in Headers */,
15AE1B8719AADA9A00C27E9E /* UIButton.h in Headers */,
@ -5603,6 +5872,7 @@
5034CA44191D591100CE6051 /* ccShader_Label.vert in Headers */,
15AE1A1419AAD3A700C27E9E /* Skeleton.h in Headers */,
1A5702F5180BCE750088DEC7 /* CCTMXObjectGroup.h in Headers */,
3828C0B819EB8ACA002AB57B /* repeated_field.h in Headers */,
1A5702F9180BCE750088DEC7 /* CCTMXTiledMap.h in Headers */,
1AC0269D1914068200FA920D /* ConvertUTF.h in Headers */,
15AE1A4419AAD3D500C27E9E /* b2DynamicTree.h in Headers */,
@ -5621,15 +5891,18 @@
1A570313180BCF190088DEC7 /* CCComponentContainer.h in Headers */,
1A087AEB1860400400196EF5 /* edtaa3func.h in Headers */,
B375107F1823ACA100B3BA6A /* CCPhysicsContactInfo_chipmunk.h in Headers */,
3828C0D419EB8ACA002AB57B /* hash.h in Headers */,
15AE1A2019AAD3A700C27E9E /* spine-cocos2dx.h in Headers */,
15AE185D19AAD31200C27E9E /* CocosDenshion.h in Headers */,
15AE194319AAD35100C27E9E /* CCColliderDetector.h in Headers */,
15AE1BC419AADFFB00C27E9E /* ExtensionMacros.h in Headers */,
15AE185A19AAD31200C27E9E /* CDConfig.h in Headers */,
1A57034E180BD09B0088DEC7 /* tinyxml2.h in Headers */,
3828C0E619EB8ACA002AB57B /* type_traits.h in Headers */,
15AE1BFE19AAE01E00C27E9E /* CCInvocation.h in Headers */,
15AE1A9E19AAD40300C27E9E /* b2StackAllocator.h in Headers */,
1A570357180BD0B00088DEC7 /* ioapi.h in Headers */,
3828C0C419EB8ACA002AB57B /* atomicops_internals_mips_gcc.h in Headers */,
15AE1A1619AAD3A700C27E9E /* SkeletonData.h in Headers */,
50ABBD4B1925AB0000A911A9 /* Mat4.h in Headers */,
15AE1BBE19AADFF000C27E9E /* SocketIO.h in Headers */,
@ -5647,7 +5920,10 @@
50ABBE6C1925AB6F00A911A9 /* CCEventListenerFocus.h in Headers */,
5034CA3E191D591100CE6051 /* ccShader_PositionColor.frag in Headers */,
50ABBE301925AB6F00A911A9 /* ccConfig.h in Headers */,
3828C0EC19EB8ACA002AB57B /* wire_format_lite.h in Headers */,
15AE195819AAD35100C27E9E /* CCInputDelegate.h in Headers */,
3828C0CE19EB8ACA002AB57B /* atomicops_internals_x86_msvc.h in Headers */,
3828C0BE19EB8ACA002AB57B /* atomicops_internals_arm_qnx.h in Headers */,
50ABBDAC1925AB4100A911A9 /* CCRenderCommandPool.h in Headers */,
5034CA3C191D591100CE6051 /* ccShader_PositionColor.vert in Headers */,
50ABC0181926664800A911A9 /* CCImage.h in Headers */,
@ -5683,10 +5959,14 @@
503DD8E01926736A00CD74DD /* CCApplication-ios.h in Headers */,
15AE1B8319AADA9A00C27E9E /* UITextBMFont.h in Headers */,
50ABBD8E1925AB4100A911A9 /* CCGLProgram.h in Headers */,
38B8E2D819E66581002D7CE7 /* CSLoader.h in Headers */,
50ABC0081926664800A911A9 /* CCApplicationProtocol.h in Headers */,
1ABA68B11888D700007D1BB4 /* CCFontCharMap.h in Headers */,
3828C0BC19EB8ACA002AB57B /* atomicops_internals_arm_gcc.h in Headers */,
15AE1ACF19AAD40300C27E9E /* b2PulleyJoint.h in Headers */,
15AE198019AAD35700C27E9E /* CCTimeLine.h in Headers */,
38B8E2D219E65F4C002D7CE7 /* CSParseBinary.pb.h in Headers */,
38B8E2E419E671D2002D7CE7 /* UILayoutComponent.h in Headers */,
50ABBD4F1925AB0000A911A9 /* MathUtil.h in Headers */,
1A01C69718F57BE800EFE3A6 /* CCInteger.h in Headers */,
15AE1C0619AAE01E00C27E9E /* CCTableViewCell.h in Headers */,
@ -5738,6 +6018,7 @@
15AE1BF619AAE01E00C27E9E /* CCControlSlider.h in Headers */,
1A01C68718F57BE800EFE3A6 /* CCArray.h in Headers */,
1A01C6A718F58F7500EFE3A6 /* CCNotificationCenter.h in Headers */,
3828C0E219EB8ACA002AB57B /* stringprintf.h in Headers */,
50ABBEDA1925AB6F00A911A9 /* ZipUtils.h in Headers */,
50ABBDC01925AB4100A911A9 /* CCTextureCache.h in Headers */,
3EA1073219D7F37700CAB794 /* CCLight.h in Headers */,
@ -5748,6 +6029,7 @@
15AE1B8519AADA9A00C27E9E /* UITextField.h in Headers */,
1A01C69318F57BE800EFE3A6 /* CCDouble.h in Headers */,
15AE184B19AAD30500C27E9E /* Export.h in Headers */,
3828C0AC19EB8ACA002AB57B /* zero_copy_stream_impl.h in Headers */,
15AE196019AAD35100C27E9E /* CCSpriteFrameCacheHelper.h in Headers */,
50ABBE221925AB6F00A911A9 /* atitc.h in Headers */,
15AE1AB719AAD40300C27E9E /* b2ContactSolver.h in Headers */,
@ -5780,6 +6062,7 @@
15AE1A4619AAD3D500C27E9E /* b2TimeOfImpact.h in Headers */,
50ABBE601925AB6F00A911A9 /* CCEventListener.h in Headers */,
50ABBEB21925AB6F00A911A9 /* CCUserDefault.h in Headers */,
3828C0C619EB8ACA002AB57B /* atomicops_internals_pnacl.h in Headers */,
15AE198B19AAD36A00C27E9E /* ButtonReader.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -5860,6 +6143,7 @@
292DB14F19B4574100A80320 /* UIEditBoxImpl-stub.cpp in Sources */,
15AE199419AAD39600C27E9E /* LayoutReader.cpp in Sources */,
1A01C68A18F57BE800EFE3A6 /* CCDeprecated.cpp in Sources */,
3828C0B519EB8ACA002AB57B /* repeated_field.cc in Sources */,
1A1645B0191B726C008C7C7F /* ConvertUTF.c in Sources */,
15AE1BE219AAE01E00C27E9E /* CCScrollView.cpp in Sources */,
50ABBD581925AB0000A911A9 /* Vec2.cpp in Sources */,
@ -5917,6 +6201,7 @@
15AE18A219AAD33D00C27E9E /* CCParticleSystemQuadLoader.cpp in Sources */,
15AE188C19AAD33D00C27E9E /* CCLabelBMFontLoader.cpp in Sources */,
15AE19E619AAD3A700C27E9E /* Skin.cpp in Sources */,
3828C0C719EB8ACA002AB57B /* atomicops_internals_x86_gcc.cc in Sources */,
DA8C62A219E52C6400000516 /* ioapi_mem.cpp in Sources */,
1A570069180BC5A10088DEC7 /* CCActionCatmullRom.cpp in Sources */,
B257B44E1989D5E800D9A687 /* CCPrimitive.cpp in Sources */,
@ -5969,14 +6254,18 @@
50ABBE391925AB6F00A911A9 /* CCData.cpp in Sources */,
1A57010E180BC8EE0088DEC7 /* CCDrawingPrimitives.cpp in Sources */,
50ABBED71925AB6F00A911A9 /* ZipUtils.cpp in Sources */,
3828C0CB19EB8ACA002AB57B /* atomicops_internals_x86_msvc.cc in Sources */,
38B8E2CF19E65F4C002D7CE7 /* CSParseBinary.pb.cc in Sources */,
292DB14919B4574100A80320 /* UIEditBoxImpl-ios.mm in Sources */,
15AE181019AAD2F700C27E9E /* CCAnimation3D.cpp in Sources */,
1A01C68418F57BE800EFE3A6 /* CCArray.cpp in Sources */,
1A570112180BC8EE0088DEC7 /* CCDrawNode.cpp in Sources */,
15AE186D19AAD31D00C27E9E /* SimpleAudioEngine_objc.m in Sources */,
3828C0DF19EB8ACA002AB57B /* stringprintf.cc in Sources */,
1A57011B180BC90D0088DEC7 /* CCGrabber.cpp in Sources */,
15AE182419AAD2F700C27E9E /* CCMesh.cpp in Sources */,
15AE190D19AAD35000C27E9E /* CCDisplayManager.cpp in Sources */,
3828C0B119EB8ACA002AB57B /* message_lite.cc in Sources */,
1A57011F180BC90D0088DEC7 /* CCGrid.cpp in Sources */,
15AE19CE19AAD3A700C27E9E /* Attachment.cpp in Sources */,
15AE187A19AAD33D00C27E9E /* CCBAnimationManager.cpp in Sources */,
@ -5984,11 +6273,13 @@
15AE1A8A19AAD40300C27E9E /* b2PulleyJoint.cpp in Sources */,
29394CF219B01DBA00D2DE1A /* UIWebView.mm in Sources */,
15AE1BD419AAE01E00C27E9E /* CCControlSaturationBrightnessPicker.cpp in Sources */,
38B8E2E119E671D2002D7CE7 /* UILayoutComponent.cpp in Sources */,
1A57019D180BCB590088DEC7 /* CCFont.cpp in Sources */,
50CB247B19D9C5A100687767 /* AudioEngine-inl.mm in Sources */,
1A5701A1180BCB590088DEC7 /* CCFontAtlas.cpp in Sources */,
15AE1A8619AAD40300C27E9E /* b2MouseJoint.cpp in Sources */,
1A5701A5180BCB590088DEC7 /* CCFontAtlasCache.cpp in Sources */,
3828C0A919EB8ACA002AB57B /* zero_copy_stream_impl.cc in Sources */,
15AE1A7A19AAD40300C27E9E /* b2PolygonContact.cpp in Sources */,
15AE191119AAD35000C27E9E /* CCProcessBase.cpp in Sources */,
15AE18EE19AAD35000C27E9E /* CCArmature.cpp in Sources */,
@ -6003,6 +6294,7 @@
292DB13D19B4574100A80320 /* UIEditBox.cpp in Sources */,
50ABBE551925AB6F00A911A9 /* CCEventFocus.cpp in Sources */,
15AE1A8819AAD40300C27E9E /* b2PrismaticJoint.cpp in Sources */,
3828C0A519EB8ACA002AB57B /* zero_copy_stream.cc in Sources */,
50ABBE491925AB6F00A911A9 /* CCEventAcceleration.cpp in Sources */,
1A5701C1180BCB5A0088DEC7 /* CCLabelBMFont.cpp in Sources */,
15AE182C19AAD2F700C27E9E /* CCMeshVertexIndexData.cpp in Sources */,
@ -6034,6 +6326,7 @@
15AE1A6A19AAD40300C27E9E /* b2ChainAndCircleContact.cpp in Sources */,
15AE19BE19AAD3A700C27E9E /* Event.cpp in Sources */,
1A5701EA180BCB8C0088DEC7 /* CCTransitionPageTurn.cpp in Sources */,
3828C0D719EB8ACA002AB57B /* once.cc in Sources */,
15AE186B19AAD31D00C27E9E /* SimpleAudioEngine.mm in Sources */,
50ABBDAD1925AB4100A911A9 /* CCRenderer.cpp in Sources */,
15AE199019AAD37200C27E9E /* ImageViewReader.cpp in Sources */,
@ -6060,6 +6353,7 @@
1A570221180BCC1A0088DEC7 /* CCParticleBatchNode.cpp in Sources */,
1A570225180BCC1A0088DEC7 /* CCParticleExamples.cpp in Sources */,
1A570229180BCC1A0088DEC7 /* CCParticleSystem.cpp in Sources */,
3828C09B19EB8ACA002AB57B /* generated_message_util.cc in Sources */,
1A57022D180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp in Sources */,
1A57027E180BCC900088DEC7 /* CCSprite.cpp in Sources */,
15AE1A7419AAD40300C27E9E /* b2EdgeAndCircleContact.cpp in Sources */,
@ -6087,6 +6381,7 @@
15AE1A2E19AAD3D500C27E9E /* b2TimeOfImpact.cpp in Sources */,
50ABC0111926664800A911A9 /* CCGLView.cpp in Sources */,
50ABBE3D1925AB6F00A911A9 /* CCDataVisitor.cpp in Sources */,
3828C09719EB8ACA002AB57B /* extension_set.cc in Sources */,
1A5702C8180BCE370088DEC7 /* CCTextFieldTTF.cpp in Sources */,
15AE19C619AAD3A700C27E9E /* AnimationState.cpp in Sources */,
15AE1B5519AADA9900C27E9E /* UIScrollView.cpp in Sources */,
@ -6111,7 +6406,6 @@
1A5702F2180BCE750088DEC7 /* CCTMXObjectGroup.cpp in Sources */,
15AE1A5B19AAD40300C27E9E /* b2Timer.cpp in Sources */,
15AE189419AAD33D00C27E9E /* CCLayerLoader.cpp in Sources */,
15AE197219AAD35700C27E9E /* CCNodeReader.cpp in Sources */,
1A5702F6180BCE750088DEC7 /* CCTMXTiledMap.cpp in Sources */,
1A5702FA180BCE750088DEC7 /* CCTMXXMLParser.cpp in Sources */,
15AE18DF19AAD35000C27E9E /* TriggerBase.cpp in Sources */,
@ -6144,6 +6438,7 @@
15AE19E419AAD3A700C27E9E /* SkeletonJson.cpp in Sources */,
1A570358180BD0B00088DEC7 /* unzip.cpp in Sources */,
15AE19D219AAD3A700C27E9E /* Bone.cpp in Sources */,
3828C0CF19EB8ACA002AB57B /* common.cc in Sources */,
15AE196E19AAD35700C27E9E /* CCActionTimelineCache.cpp in Sources */,
50ABBEB31925AB6F00A911A9 /* CCUserDefault-apple.mm in Sources */,
50ABBEB51925AB6F00A911A9 /* CCUserDefault-android.cpp in Sources */,
@ -6155,6 +6450,7 @@
50CB247719D9C5A100687767 /* AudioCache.mm in Sources */,
15AE19C819AAD3A700C27E9E /* AnimationStateData.cpp in Sources */,
15AE18FA19AAD35000C27E9E /* CCColliderDetector.cpp in Sources */,
3828C0E919EB8ACA002AB57B /* wire_format_lite.cc in Sources */,
50ABBEA71925AB6F00A911A9 /* CCTouch.cpp in Sources */,
15AE191319AAD35000C27E9E /* CCSGUIReader.cpp in Sources */,
15AE186819AAD31D00C27E9E /* CDXMacOSXSupport.mm in Sources */,
@ -6189,12 +6485,15 @@
15AE1B6719AADA9900C27E9E /* UIScale9Sprite.cpp in Sources */,
292DB14319B4574100A80320 /* UIEditBoxImpl-android.cpp in Sources */,
15AE1A5219AAD40300C27E9E /* b2Draw.cpp in Sources */,
3828C09F19EB8ACA002AB57B /* coded_stream.cc in Sources */,
50ED2BE419BEAF7900A0AB90 /* UIEditBoxImpl-win32.cpp in Sources */,
50ABBE1F1925AB6F00A911A9 /* atitc.cpp in Sources */,
1A01C69818F57BE800EFE3A6 /* CCSet.cpp in Sources */,
1AAF584F180E40B9000584C8 /* LocalStorage.cpp in Sources */,
15AE1BD219AAE01E00C27E9E /* CCControlPotentiometer.cpp in Sources */,
50ABBEA31925AB6F00A911A9 /* CCScriptSupport.cpp in Sources */,
3828C0AD19EB8ACA002AB57B /* zero_copy_stream_impl_lite.cc in Sources */,
38B8E2D519E66581002D7CE7 /* CSLoader.cpp in Sources */,
15AE190519AAD35000C27E9E /* CCDataReaderHelper.cpp in Sources */,
15AE19A019AAD39600C27E9E /* TextAtlasReader.cpp in Sources */,
15AE1A2A19AAD3D500C27E9E /* b2Distance.cpp in Sources */,
@ -6281,7 +6580,6 @@
1A01C69918F57BE800EFE3A6 /* CCSet.cpp in Sources */,
1A01C69D18F57BE800EFE3A6 /* CCString.cpp in Sources */,
15AE199219AAD37300C27E9E /* ImageViewReader.cpp in Sources */,
15AE197D19AAD35700C27E9E /* CCNodeReader.cpp in Sources */,
2986667F18B1B246000E39CA /* CCTweenFunction.cpp in Sources */,
46A171051807CECB005B8026 /* CCPhysicsWorld.cpp in Sources */,
50ABBDA01925AB4100A911A9 /* CCGroupCommand.cpp in Sources */,
@ -6303,6 +6601,7 @@
15AE18C719AAD33D00C27E9E /* CCMenuItemImageLoader.cpp in Sources */,
50ABC01A1926664800A911A9 /* CCSAXParser.cpp in Sources */,
B2CC507C19776DD10041958E /* CCPhysicsJoint.cpp in Sources */,
38B8E2E219E671D2002D7CE7 /* UILayoutComponent.cpp in Sources */,
B2165EEA19921124000BE3E6 /* CCPrimitiveCommand.cpp in Sources */,
15AE185C19AAD31200C27E9E /* CDOpenALSupport.m in Sources */,
15AE186119AAD31200C27E9E /* SimpleAudioEngine_objc.m in Sources */,
@ -6310,12 +6609,14 @@
503DD8EE1926736A00CD74DD /* CCImage-ios.mm in Sources */,
B37510811823ACA100B3BA6A /* CCPhysicsJointInfo_chipmunk.cpp in Sources */,
46A170FC1807CECB005B8026 /* CCPhysicsBody.cpp in Sources */,
3828C0C819EB8ACA002AB57B /* atomicops_internals_x86_gcc.cc in Sources */,
15AE1BEA19AAE01E00C27E9E /* CCControlButton.cpp in Sources */,
50ABBD941925AB4100A911A9 /* CCGLProgramState.cpp in Sources */,
B257B44F1989D5E800D9A687 /* CCPrimitive.cpp in Sources */,
50ABBE281925AB6F00A911A9 /* CCAutoreleasePool.cpp in Sources */,
15AE18D519AAD33D00C27E9E /* CCScale9SpriteLoader.cpp in Sources */,
15AE192919AAD35100C27E9E /* TriggerMng.cpp in Sources */,
3828C0A619EB8ACA002AB57B /* zero_copy_stream.cc in Sources */,
15AE185E19AAD31200C27E9E /* CocosDenshion.m in Sources */,
46A170FE1807CECB005B8026 /* CCPhysicsContact.cpp in Sources */,
15AE1A0719AAD3A700C27E9E /* BoneData.cpp in Sources */,
@ -6325,7 +6626,9 @@
15AE1C0119AAE01E00C27E9E /* CCScrollView.cpp in Sources */,
15AE1A9B19AAD40300C27E9E /* b2Settings.cpp in Sources */,
1A57006A180BC5A10088DEC7 /* CCActionCatmullRom.cpp in Sources */,
3828C0D019EB8ACA002AB57B /* common.cc in Sources */,
15AE1BEF19AAE01E00C27E9E /* CCControlHuePicker.cpp in Sources */,
3828C0A019EB8ACA002AB57B /* coded_stream.cc in Sources */,
15AE197B19AAD35700C27E9E /* CCFrame.cpp in Sources */,
15AE1ABE19AAD40300C27E9E /* b2PolygonContact.cpp in Sources */,
1A57006E180BC5A10088DEC7 /* CCActionEase.cpp in Sources */,
@ -6349,6 +6652,7 @@
15AE1ACA19AAD40300C27E9E /* b2MouseJoint.cpp in Sources */,
15AE19AC19AAD39700C27E9E /* LoadingBarReader.cpp in Sources */,
50ABBE7E1925AB6F00A911A9 /* CCEventTouch.cpp in Sources */,
3828C0AE19EB8ACA002AB57B /* zero_copy_stream_impl_lite.cc in Sources */,
15AE183119AAD2F700C27E9E /* CCOBB.cpp in Sources */,
15AE18C519AAD33D00C27E9E /* CCLayerLoader.cpp in Sources */,
15AE1BF719AAE01E00C27E9E /* CCControlStepper.cpp in Sources */,
@ -6365,8 +6669,10 @@
15AE181719AAD2F700C27E9E /* CCAttachNode.cpp in Sources */,
15AE18B719AAD33D00C27E9E /* CCBSequenceProperty.cpp in Sources */,
15AE1A1119AAD3A700C27E9E /* RegionAttachment.cpp in Sources */,
3828C0E019EB8ACA002AB57B /* stringprintf.cc in Sources */,
15AE18B919AAD33D00C27E9E /* CCControlButtonLoader.cpp in Sources */,
50ABBE761925AB6F00A911A9 /* CCEventListenerTouch.cpp in Sources */,
3828C0AA19EB8ACA002AB57B /* zero_copy_stream_impl.cc in Sources */,
15AE1AD219AAD40300C27E9E /* b2RopeJoint.cpp in Sources */,
15AE1A4919AAD3D500C27E9E /* b2CircleShape.cpp in Sources */,
15AE184119AAD2F700C27E9E /* CCSprite3D.cpp in Sources */,
@ -6396,6 +6702,7 @@
50ABBE421925AB6F00A911A9 /* CCDirector.cpp in Sources */,
15AE1C0319AAE01E00C27E9E /* CCTableView.cpp in Sources */,
15AE1A1B19AAD3A700C27E9E /* Slot.cpp in Sources */,
38B8E2D019E65F4C002D7CE7 /* CSParseBinary.pb.cc in Sources */,
1A57007E180BC5A10088DEC7 /* CCActionInterval.cpp in Sources */,
15AE19F319AAD3A700C27E9E /* EventData.cpp in Sources */,
15AE1BF319AAE01E00C27E9E /* CCControlSaturationBrightnessPicker.cpp in Sources */,
@ -6459,8 +6766,10 @@
15AE1A3D19AAD3D500C27E9E /* b2CollideEdge.cpp in Sources */,
1A5701C2180BCB5A0088DEC7 /* CCLabelBMFont.cpp in Sources */,
1A087AE91860400400196EF5 /* edtaa3func.cpp in Sources */,
3828C0EA19EB8ACA002AB57B /* wire_format_lite.cc in Sources */,
15AE194219AAD35100C27E9E /* CCColliderDetector.cpp in Sources */,
15AE1A9919AAD40300C27E9E /* b2Math.cpp in Sources */,
3828C0B619EB8ACA002AB57B /* repeated_field.cc in Sources */,
15AE1A0B19AAD3A700C27E9E /* CCSkeletonAnimation.cpp in Sources */,
15AE1B7C19AADA9A00C27E9E /* UISlider.cpp in Sources */,
15AE1AA519AAD40300C27E9E /* b2Fixture.cpp in Sources */,
@ -6489,6 +6798,7 @@
15AE1A9D19AAD40300C27E9E /* b2StackAllocator.cpp in Sources */,
1A5701EF180BCB8C0088DEC7 /* CCTransitionProgress.cpp in Sources */,
1A5701F8180BCBAD0088DEC7 /* CCMenu.cpp in Sources */,
3828C0CC19EB8ACA002AB57B /* atomicops_internals_x86_msvc.cc in Sources */,
50ABBD511925AB0000A911A9 /* Quaternion.cpp in Sources */,
1A5701FC180BCBAD0088DEC7 /* CCMenuItem.cpp in Sources */,
15AE195119AAD35100C27E9E /* CCDecorativeDisplay.cpp in Sources */,
@ -6588,6 +6898,7 @@
B375107C1823ACA100B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp in Sources */,
50ABBEB61925AB6F00A911A9 /* CCUserDefault-android.cpp in Sources */,
1A57034C180BD09B0088DEC7 /* tinyxml2.cpp in Sources */,
3828C0D819EB8ACA002AB57B /* once.cc in Sources */,
50ABBDB61925AB4100A911A9 /* CCTexture2D.cpp in Sources */,
15AE1BAB19AADFDF00C27E9E /* UILayout.cpp in Sources */,
1A570355180BD0B00088DEC7 /* ioapi.cpp in Sources */,
@ -6633,6 +6944,7 @@
50ABBEA41925AB6F00A911A9 /* CCScriptSupport.cpp in Sources */,
3E6176761960F89B00DE83F5 /* CCEventListenerController.cpp in Sources */,
15AE1AC219AAD40300C27E9E /* b2DistanceJoint.cpp in Sources */,
3828C0B219EB8ACA002AB57B /* message_lite.cc in Sources */,
503DD8E71926736A00CD74DD /* CCEAGLView-ios.mm in Sources */,
3E2BDAEC19C0436F0055CDCD /* AudioEngine.cpp in Sources */,
50ABBDA41925AB4100A911A9 /* CCQuadCommand.cpp in Sources */,
@ -6663,8 +6975,10 @@
15AE18CC19AAD33D00C27E9E /* CCNode+CCBRelativePositioning.cpp in Sources */,
50CB247819D9C5A100687767 /* AudioCache.mm in Sources */,
50ABBD5D1925AB0000A911A9 /* Vec3.cpp in Sources */,
38B8E2D619E66581002D7CE7 /* CSLoader.cpp in Sources */,
50ABC0121926664800A911A9 /* CCGLView.cpp in Sources */,
50ABC0021926664800A911A9 /* CCLock-apple.cpp in Sources */,
3828C09819EB8ACA002AB57B /* extension_set.cc in Sources */,
50ABBEBC1925AB6F00A911A9 /* ccUtils.cpp in Sources */,
15AE1A4719AAD3D500C27E9E /* b2ChainShape.cpp in Sources */,
50ABBE721925AB6F00A911A9 /* CCEventListenerMouse.cpp in Sources */,
@ -6686,6 +7000,7 @@
1A1645B1191B726C008C7C7F /* ConvertUTF.c in Sources */,
50ABBE3A1925AB6F00A911A9 /* CCData.cpp in Sources */,
1A1645B3191B726C008C7C7F /* ConvertUTFWrapper.cpp in Sources */,
3828C09C19EB8ACA002AB57B /* generated_message_util.cc in Sources */,
1ABA68AF1888D700007D1BB4 /* CCFontCharMap.cpp in Sources */,
15AE180D19AAD2F700C27E9E /* CCAnimate3D.cpp in Sources */,
50ABBE7A1925AB6F00A911A9 /* CCEventMouse.cpp in Sources */,
@ -6731,7 +7046,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../external";
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../external $(SRCROOT)/../external/protobuf-lite/src";
};
name = Debug;
};
@ -6764,7 +7079,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../external";
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../external $(SRCROOT)/../external/protobuf-lite/src";
VALIDATE_PRODUCT = YES;
};
name = Release;

View File

@ -131,6 +131,7 @@ public:
virtual void setSystemFontSize(float fontSize);
virtual float getSystemFontSize() const { return _systemFontSize;}
virtual void requestSystemFontRefresh() { _systemFontDirty = true;}
/** changes the string to render
* @warning It is as expensive as changing the string if you haven't set up TTF/BMFont/CharMap for the label.
*/

View File

@ -78,7 +78,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\protobuf-lite\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WP8;_LIB;_DEBUG;COCOS2D_DEBUG=1;CC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
@ -103,7 +103,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\protobuf-lite\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WP8;_LIB;NDEBUG;CC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
@ -128,7 +128,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\protobuf-lite\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WP8;_LIB;_DEBUG;COCOS2D_DEBUG=1;CC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
@ -154,7 +154,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\protobuf-lite\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WP8;_LIB;NDEBUG;CC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
@ -202,6 +202,19 @@
</ClCompile>
<ClCompile Include="..\..\external\ConvertUTF\ConvertUTFWrapper.cpp" />
<ClCompile Include="..\..\external\edtaa3func\edtaa3func.cpp" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\extension_set.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\generated_message_util.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\coded_stream.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl_lite.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\message_lite.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\repeated_field.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_x86_msvc.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\common.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\once.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\stringprintf.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\wire_format_lite.cc" />
<ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp" />
<ClCompile Include="..\..\external\unzip\ioapi_mem.cpp" />
<ClCompile Include="..\..\external\unzip\ioapi.cpp" />
@ -444,6 +457,28 @@
<ItemGroup>
<ClInclude Include="..\..\external\ConvertUTF\ConvertUTF.h" />
<ClInclude Include="..\..\external\edtaa3func\edtaa3func.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\extension_set.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\generated_message_util.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\coded_stream.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\coded_stream_inl.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl_lite.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\message_lite.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\repeated_field.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_x86_msvc.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\common.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\hash.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\map-util.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\once.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\platform_macros.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\stl_util.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\stringprintf.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\template_util.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\type_traits.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\wire_format_lite.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\wire_format_lite_inl.h" />
<ClInclude Include="..\..\external\protobuf-lite\win32\config.h" />
<ClInclude Include="..\..\external\tinyxml2\tinyxml2.h" />
<ClInclude Include="..\..\external\unzip\ioapi_mem.h" />
<ClInclude Include="..\..\external\unzip\ioapi.h" />

View File

@ -55,6 +55,15 @@
<Filter Include="2d">
<UniqueIdentifier>{fdee8fd3-05f9-46a1-aa15-6ceb16358145}</UniqueIdentifier>
</Filter>
<Filter Include="external\protobuf-lite">
<UniqueIdentifier>{85e8e428-d95d-4ca2-9765-c27ce7571bc4}</UniqueIdentifier>
</Filter>
<Filter Include="external\protobuf-lite\io">
<UniqueIdentifier>{f57aa1db-2f62-429c-bdf2-c772da13b9fe}</UniqueIdentifier>
</Filter>
<Filter Include="external\protobuf-lite\stubs">
<UniqueIdentifier>{f8d8f14c-cf4b-41a4-8948-6abdb29edcad}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\physics\CCPhysicsBody.cpp">
@ -668,6 +677,45 @@
<ClCompile Include="..\base\CCLight.cpp">
<Filter>base</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\coded_stream.cc">
<Filter>external\protobuf-lite\io</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream.cc">
<Filter>external\protobuf-lite\io</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl.cc">
<Filter>external\protobuf-lite\io</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl_lite.cc">
<Filter>external\protobuf-lite\io</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_x86_msvc.cc">
<Filter>external\protobuf-lite\stubs</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\common.cc">
<Filter>external\protobuf-lite\stubs</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\once.cc">
<Filter>external\protobuf-lite\stubs</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\stringprintf.cc">
<Filter>external\protobuf-lite\stubs</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\extension_set.cc">
<Filter>external\protobuf-lite</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\generated_message_util.cc">
<Filter>external\protobuf-lite</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\message_lite.cc">
<Filter>external\protobuf-lite</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\repeated_field.cc">
<Filter>external\protobuf-lite</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\wire_format_lite.cc">
<Filter>external\protobuf-lite</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\physics\CCPhysicsBody.h">
@ -1376,6 +1424,72 @@
<ClInclude Include="..\base\CCLight.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\coded_stream.h">
<Filter>external\protobuf-lite\io</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\coded_stream_inl.h">
<Filter>external\protobuf-lite\io</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream.h">
<Filter>external\protobuf-lite\io</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl.h">
<Filter>external\protobuf-lite\io</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl_lite.h">
<Filter>external\protobuf-lite\io</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_x86_msvc.h">
<Filter>external\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\common.h">
<Filter>external\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\hash.h">
<Filter>external\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\map-util.h">
<Filter>external\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\once.h">
<Filter>external\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\platform_macros.h">
<Filter>external\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\stl_util.h">
<Filter>external\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\stringprintf.h">
<Filter>external\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\template_util.h">
<Filter>external\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\type_traits.h">
<Filter>external\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\extension_set.h">
<Filter>external\protobuf-lite</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\generated_message_util.h">
<Filter>external\protobuf-lite</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\message_lite.h">
<Filter>external\protobuf-lite</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\repeated_field.h">
<Filter>external\protobuf-lite</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\wire_format_lite.h">
<Filter>external\protobuf-lite</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\wire_format_lite_inl.h">
<Filter>external\protobuf-lite</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\win32\config.h">
<Filter>external\protobuf-lite</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\math\Mat4.inl">

View File

@ -77,8 +77,8 @@
</PreBuildEvent>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot)external\box2d;$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\win32;$(EngineRoot)external\jpeg\include\win32;$(EngineRoot)external\tiff\include\win32;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\win32;$(EngineRoot)external\win32-specific\OpenalSoft\include;$(EngineRoot)external\win32-specific\MP3Decoder\include;$(EngineRoot)external\win32-specific\OggDecoder\include;$(EngineRoot)external\win32-specific\icon\include;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\websockets\include\win32;$(EngineRoot)external;$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_USRDLL;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot)external\box2d;$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\win32;$(EngineRoot)external\jpeg\include\win32;$(EngineRoot)external\tiff\include\win32;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\win32;$(EngineRoot)external\win32-specific\OpenalSoft\include;$(EngineRoot)external\win32-specific\MP3Decoder\include;$(EngineRoot)external\win32-specific\OggDecoder\include;$(EngineRoot)external\win32-specific\icon\include;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\websockets\include\win32;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external;$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_USRDLL;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;PROTOBUF_USE_DLLS;LIBPROTOBUF_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@ -132,8 +132,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\debug-lib\*.*"
</Command>
</PreBuildEvent>
<ClCompile>
<AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\win32;$(EngineRoot)external\jpeg\include\win32;$(EngineRoot)external\tiff\include\win32;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\win32;$(EngineRoot)external\win32-specific\MP3Decoder\include;$(EngineRoot)external\win32-specific\OggDecoder\include;$(EngineRoot)external\win32-specific\OpenalSoft\include;$(EngineRoot)external\win32-specific\icon\include;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\Box2d;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\websockets\include\win32\;$(EngineRoot)external;$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_USRDLL;NDEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\win32;$(EngineRoot)external\jpeg\include\win32;$(EngineRoot)external\tiff\include\win32;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\win32;$(EngineRoot)external\win32-specific\MP3Decoder\include;$(EngineRoot)external\win32-specific\OggDecoder\include;$(EngineRoot)external\win32-specific\OpenalSoft\include;$(EngineRoot)external\win32-specific\icon\include;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\Box2d;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\websockets\include\win32\;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external;$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_USRDLL;NDEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;PROTOBUF_USE_DLLS;LIBPROTOBUF_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
@ -203,6 +203,20 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\..\external\ConvertUTF\ConvertUTF.c" />
<ClCompile Include="..\..\external\ConvertUTF\ConvertUTFWrapper.cpp" />
<ClCompile Include="..\..\external\edtaa3func\edtaa3func.cpp" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\extension_set.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\generated_message_util.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\coded_stream.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl_lite.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\message_lite.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\repeated_field.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_x86_gcc.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_x86_msvc.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\common.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\once.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\stringprintf.cc" />
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\wire_format_lite.cc" />
<ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp" />
<ClCompile Include="..\..\external\unzip\ioapi_mem.cpp" />
<ClCompile Include="..\..\external\unzip\ioapi.cpp" />
@ -310,6 +324,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\editor-support\cocostudio\ActionTimeline\CCFrame.cpp" />
<ClCompile Include="..\editor-support\cocostudio\ActionTimeline\CCNodeReader.cpp" />
<ClCompile Include="..\editor-support\cocostudio\ActionTimeline\CCTimeLine.cpp" />
<ClCompile Include="..\editor-support\cocostudio\ActionTimeline\CSLoader.cpp" />
<ClCompile Include="..\editor-support\cocostudio\CCActionFrame.cpp" />
<ClCompile Include="..\editor-support\cocostudio\CCActionFrameEasing.cpp" />
<ClCompile Include="..\editor-support\cocostudio\CCActionManagerEx.cpp" />
@ -341,6 +356,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\editor-support\cocostudio\CCTween.cpp" />
<ClCompile Include="..\editor-support\cocostudio\CCUtilMath.cpp" />
<ClCompile Include="..\editor-support\cocostudio\CocoLoader.cpp" />
<ClCompile Include="..\editor-support\cocostudio\CSParseBinary.pb.cc" />
<ClCompile Include="..\editor-support\cocostudio\DictionaryHelper.cpp" />
<ClCompile Include="..\editor-support\cocostudio\TriggerBase.cpp" />
<ClCompile Include="..\editor-support\cocostudio\TriggerMng.cpp" />
@ -425,6 +441,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\ui\UIHelper.cpp" />
<ClCompile Include="..\ui\UIImageView.cpp" />
<ClCompile Include="..\ui\UILayout.cpp" />
<ClCompile Include="..\ui\UILayoutComponent.cpp" />
<ClCompile Include="..\ui\UILayoutManager.cpp" />
<ClCompile Include="..\ui\UILayoutParameter.cpp" />
<ClCompile Include="..\ui\UIListView.cpp" />
@ -544,6 +561,36 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\..\external\json\reader.h" />
<ClInclude Include="..\..\external\json\stringbuffer.h" />
<ClInclude Include="..\..\external\json\writer.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\extension_set.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\generated_message_util.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\coded_stream.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\coded_stream_inl.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl_lite.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\message_lite.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\repeated_field.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_arm_gcc.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_arm_qnx.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_atomicword_compat.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_macosx.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_mips_gcc.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_pnacl.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_x86_gcc.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_x86_msvc.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\common.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\hash.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\map-util.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\once.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\platform_macros.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\stl_util.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\stringprintf.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\template_util.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\type_traits.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\wire_format_lite.h" />
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\wire_format_lite_inl.h" />
<ClInclude Include="..\..\external\protobuf-lite\win32\config.h" />
<ClInclude Include="..\..\external\tinyxml2\tinyxml2.h" />
<ClInclude Include="..\..\external\unzip\ioapi_mem.h" />
<ClInclude Include="..\..\external\unzip\ioapi.h" />
@ -679,6 +726,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\editor-support\cocostudio\ActionTimeline\CCNodeReader.h" />
<ClInclude Include="..\editor-support\cocostudio\ActionTimeline\CCTimeLine.h" />
<ClInclude Include="..\editor-support\cocostudio\ActionTimeline\CCTimelineMacro.h" />
<ClInclude Include="..\editor-support\cocostudio\ActionTimeline\CSLoader.h" />
<ClInclude Include="..\editor-support\cocostudio\CCActionFrame.h" />
<ClInclude Include="..\editor-support\cocostudio\CCActionFrameEasing.h" />
<ClInclude Include="..\editor-support\cocostudio\CCActionManagerEx.h" />
@ -713,6 +761,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\editor-support\cocostudio\CocoLoader.h" />
<ClInclude Include="..\editor-support\cocostudio\CocosStudioExport.h" />
<ClInclude Include="..\editor-support\cocostudio\CocoStudio.h" />
<ClInclude Include="..\editor-support\cocostudio\CSParseBinary.pb.h" />
<ClInclude Include="..\editor-support\cocostudio\DictionaryHelper.h" />
<ClInclude Include="..\editor-support\cocostudio\TriggerBase.h" />
<ClInclude Include="..\editor-support\cocostudio\TriggerMng.h" />
@ -810,6 +859,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\ui\UIHelper.h" />
<ClInclude Include="..\ui\UIImageView.h" />
<ClInclude Include="..\ui\UILayout.h" />
<ClInclude Include="..\ui\UILayoutComponent.h" />
<ClInclude Include="..\ui\UILayoutManager.h" />
<ClInclude Include="..\ui\UILayoutParameter.h" />
<ClInclude Include="..\ui\UIListView.h" />

View File

@ -112,9 +112,6 @@
<Filter Include="ui\UIWidgets\ScrollWidget">
<UniqueIdentifier>{6ac0e3c8-d5b1-44d9-8c41-21662a767cc6}</UniqueIdentifier>
</Filter>
<Filter Include="cocostudio\trigger">
<UniqueIdentifier>{0554a5b1-03a1-4d38-87a5-976dbe9a39d9}</UniqueIdentifier>
</Filter>
<Filter Include="cocostudio\TimelineAction">
<UniqueIdentifier>{c75d4c37-d555-4a5b-a0ba-4bc9a3d846e1}</UniqueIdentifier>
</Filter>
@ -214,6 +211,18 @@
<Filter Include="audioengine">
<UniqueIdentifier>{e916e2b4-0a6e-4d25-8b36-66fa03719f48}</UniqueIdentifier>
</Filter>
<Filter Include="cocostudio\json\protobuf-lite">
<UniqueIdentifier>{cca5b284-43d5-4f19-8a3f-41011ca8fb78}</UniqueIdentifier>
</Filter>
<Filter Include="cocostudio\json\protobuf-lite\io">
<UniqueIdentifier>{95d0a465-a443-4974-ac90-ca1a46cd3066}</UniqueIdentifier>
</Filter>
<Filter Include="cocostudio\json\protobuf-lite\stubs">
<UniqueIdentifier>{65b452e4-00df-4ab1-803a-af3fb369edc4}</UniqueIdentifier>
</Filter>
<Filter Include="cocostudio\TimelineAction\trigger">
<UniqueIdentifier>{0554a5b1-03a1-4d38-87a5-976dbe9a39d9}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\physics\CCPhysicsBody.cpp">
@ -881,13 +890,13 @@
<Filter>ui\UIWidgets\ScrollWidget</Filter>
</ClCompile>
<ClCompile Include="..\editor-support\cocostudio\TriggerBase.cpp">
<Filter>cocostudio\trigger</Filter>
<Filter>cocostudio\TimelineAction\trigger</Filter>
</ClCompile>
<ClCompile Include="..\editor-support\cocostudio\TriggerMng.cpp">
<Filter>cocostudio\trigger</Filter>
<Filter>cocostudio\TimelineAction\trigger</Filter>
</ClCompile>
<ClCompile Include="..\editor-support\cocostudio\TriggerObj.cpp">
<Filter>cocostudio\trigger</Filter>
<Filter>cocostudio\TimelineAction\trigger</Filter>
</ClCompile>
<ClCompile Include="..\editor-support\cocostudio\ActionTimeline\CCActionTimeline.cpp">
<Filter>cocostudio\TimelineAction</Filter>
@ -895,9 +904,6 @@
<ClCompile Include="..\editor-support\cocostudio\ActionTimeline\CCFrame.cpp">
<Filter>cocostudio\TimelineAction</Filter>
</ClCompile>
<ClCompile Include="..\editor-support\cocostudio\ActionTimeline\CCNodeReader.cpp">
<Filter>cocostudio\TimelineAction</Filter>
</ClCompile>
<ClCompile Include="..\editor-support\cocostudio\ActionTimeline\CCActionTimelineCache.cpp">
<Filter>cocostudio\TimelineAction</Filter>
</ClCompile>
@ -1192,6 +1198,58 @@
<ClCompile Include="..\audio\win32\AudioPlayer.cpp">
<Filter>audioengine</Filter>
</ClCompile>
<ClCompile Include="..\editor-support\cocostudio\ActionTimeline\CCNodeReader.cpp" />
<ClCompile Include="..\editor-support\cocostudio\CSParseBinary.pb.cc">
<Filter>cocostudio\json</Filter>
</ClCompile>
<ClCompile Include="..\editor-support\cocostudio\ActionTimeline\CSLoader.cpp">
<Filter>cocostudio\TimelineAction</Filter>
</ClCompile>
<ClCompile Include="..\ui\UILayoutComponent.cpp">
<Filter>ui\Layouts</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\extension_set.cc">
<Filter>cocostudio\json\protobuf-lite</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\generated_message_util.cc">
<Filter>cocostudio\json\protobuf-lite</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\message_lite.cc">
<Filter>cocostudio\json\protobuf-lite</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\repeated_field.cc">
<Filter>cocostudio\json\protobuf-lite</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\wire_format_lite.cc">
<Filter>cocostudio\json\protobuf-lite</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\coded_stream.cc">
<Filter>cocostudio\json\protobuf-lite\io</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream.cc">
<Filter>cocostudio\json\protobuf-lite\io</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl.cc">
<Filter>cocostudio\json\protobuf-lite\io</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl_lite.cc">
<Filter>cocostudio\json\protobuf-lite\io</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_x86_gcc.cc">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_x86_msvc.cc">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\common.cc">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\once.cc">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClCompile>
<ClCompile Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\stringprintf.cc">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\physics\CCPhysicsBody.h">
@ -1967,13 +2025,13 @@
<Filter>cocostudio</Filter>
</ClInclude>
<ClInclude Include="..\editor-support\cocostudio\TriggerBase.h">
<Filter>cocostudio\trigger</Filter>
<Filter>cocostudio\TimelineAction\trigger</Filter>
</ClInclude>
<ClInclude Include="..\editor-support\cocostudio\TriggerMng.h">
<Filter>cocostudio\trigger</Filter>
<Filter>cocostudio\TimelineAction\trigger</Filter>
</ClInclude>
<ClInclude Include="..\editor-support\cocostudio\TriggerObj.h">
<Filter>cocostudio\trigger</Filter>
<Filter>cocostudio\TimelineAction\trigger</Filter>
</ClInclude>
<ClInclude Include="..\editor-support\cocostudio\ActionTimeline\CCActionTimeline.h">
<Filter>cocostudio\TimelineAction</Filter>
@ -1981,9 +2039,6 @@
<ClInclude Include="..\editor-support\cocostudio\ActionTimeline\CCFrame.h">
<Filter>cocostudio\TimelineAction</Filter>
</ClInclude>
<ClInclude Include="..\editor-support\cocostudio\ActionTimeline\CCNodeReader.h">
<Filter>cocostudio\TimelineAction</Filter>
</ClInclude>
<ClInclude Include="..\editor-support\cocostudio\ActionTimeline\CCActionTimelineCache.h">
<Filter>cocostudio\TimelineAction</Filter>
</ClInclude>
@ -2344,6 +2399,106 @@
<ClInclude Include="..\audio\win32\AudioPlayer.h">
<Filter>audioengine</Filter>
</ClInclude>
<ClInclude Include="..\editor-support\cocostudio\ActionTimeline\CCNodeReader.h" />
<ClInclude Include="..\editor-support\cocostudio\CSParseBinary.pb.h">
<Filter>cocostudio\json</Filter>
</ClInclude>
<ClInclude Include="..\editor-support\cocostudio\ActionTimeline\CSLoader.h">
<Filter>cocostudio\TimelineAction</Filter>
</ClInclude>
<ClInclude Include="..\ui\UILayoutComponent.h">
<Filter>ui\Layouts</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\extension_set.h">
<Filter>cocostudio\json\protobuf-lite</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\generated_message_util.h">
<Filter>cocostudio\json\protobuf-lite</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\message_lite.h">
<Filter>cocostudio\json\protobuf-lite</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\repeated_field.h">
<Filter>cocostudio\json\protobuf-lite</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\wire_format_lite.h">
<Filter>cocostudio\json\protobuf-lite</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\wire_format_lite_inl.h">
<Filter>cocostudio\json\protobuf-lite</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\win32\config.h">
<Filter>cocostudio\json\protobuf-lite</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\coded_stream.h">
<Filter>cocostudio\json\protobuf-lite\io</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\coded_stream_inl.h">
<Filter>cocostudio\json\protobuf-lite\io</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream.h">
<Filter>cocostudio\json\protobuf-lite\io</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl.h">
<Filter>cocostudio\json\protobuf-lite\io</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\io\zero_copy_stream_impl_lite.h">
<Filter>cocostudio\json\protobuf-lite\io</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_arm_gcc.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_arm_qnx.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_atomicword_compat.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_macosx.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_mips_gcc.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_pnacl.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_x86_gcc.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\atomicops_internals_x86_msvc.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\common.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\hash.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\map-util.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\once.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\platform_macros.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\stl_util.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\stringprintf.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\template_util.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
<ClInclude Include="..\..\external\protobuf-lite\src\google\protobuf\stubs\type_traits.h">
<Filter>cocostudio\json\protobuf-lite\stubs</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\math\Mat4.inl">

View File

@ -270,4 +270,6 @@ $(call import-module,extensions)
$(call import-module,Box2D)
$(call import-module,curl/prebuilt/android)
$(call import-module,websockets/prebuilt/android)
$(call import-module,protobuf-lite)

View File

@ -125,7 +125,7 @@ elseif(WINDOWS)
set(PLATFORM_SPECIFIC_LIBS libjpeg libpng libwebp libtiff libcurl_imp libwebsockets freetype250 glfw3 glew32 opengl32 libiconv libzlib)
elseif(LINUX)
set(PLATFORM_SPECIFIC_LIBS jpeg webp tiff freetype curl websockets
fontconfig png pthread glfw GLEW GL X11 rt z ${FMOD_LIB})
fontconfig png pthread glfw GLEW GL X11 rt z protobuf ${FMOD_LIB})
elseif(MACOSX)
INCLUDE_DIRECTORIES ( /System/Library/Frameworks )

View File

@ -23,7 +23,7 @@ THE SOFTWARE.
****************************************************************************/
#include "CCActionTimelineCache.h"
#include "CCNodeReader.h"
#include "CSLoader.h"
#include "CCFrame.h"
#include "CCTimeLine.h"
#include "CCActionTimeline.h"
@ -31,6 +31,11 @@ THE SOFTWARE.
#include "2d/CCSpriteFrameCache.h"
#include "2d/CCSpriteFrame.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
#include <fstream>
using namespace cocos2d;
namespace cocostudio {
@ -120,7 +125,28 @@ void ActionTimelineCache::removeAction(const std::string& fileName)
}
}
ActionTimeline* ActionTimelineCache::createAction(const std::string& fileName)
ActionTimeline* ActionTimelineCache::createAction(const std::string& filename)
{
std::string path = filename;
size_t pos = path.find_last_of('.');
std::string suffix = path.substr(pos + 1, path.length());
CCLOG("suffix = %s", suffix.c_str());
ActionTimelineCache* cache = ActionTimelineCache::getInstance();
if (suffix == "csb")
{
return cache->createActionFromProtocolBuffers(filename);
}
else if (suffix == "json" || suffix == "ExportJson")
{
return cache->createActionFromJson(filename);
}
return nullptr;
}
ActionTimeline* ActionTimelineCache::createActionFromJson(const std::string& fileName)
{
ActionTimeline* action = _animationActions.at(fileName);
if (action == nullptr)
@ -174,6 +200,59 @@ ActionTimeline* ActionTimelineCache::loadAnimationActionWithContent(const std::s
return action;
}
ActionTimeline* ActionTimelineCache::createActionFromProtocolBuffers(const std::string &fileName)
{
ActionTimeline* action = _animationActions.at(fileName);
if (action == NULL)
{
action = loadAnimationActionWithFileFromProtocolBuffers(fileName);
}
return action->clone();
}
ActionTimeline* ActionTimelineCache::loadAnimationActionWithFileFromProtocolBuffers(const std::string &fileName)
{
// if already exists an action with filename, then return this action
ActionTimeline* action = _animationActions.at(fileName);
if (action)
return action;
std::string path = fileName;
// int pos = path.find_last_of('/');
// _protocolBuffersPath = path.substr(0, pos + 1);
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName.c_str());
Data content = FileUtils::getInstance()->getDataFromFile(fullPath);
protocolbuffers::CSParseBinary gpbwp;
// protocolbuffers::GUIProtocolBuffersProtobuf gpbwp;
if (!gpbwp.ParseFromArray(content.getBytes(), content.getSize()))
{
return NULL;
}
const protocolbuffers::NodeAction& actionProtobuf = gpbwp.action();
action = ActionTimeline::create();
action->setDuration(actionProtobuf.duration());
action->setTimeSpeed((actionProtobuf.has_speed()) ? actionProtobuf.speed() : 1.0f);
int timelineLength = actionProtobuf.timelines_size();
for (int i = 0; i < timelineLength; i++)
{
const protocolbuffers::TimeLine& timelineProtobuf = actionProtobuf.timelines(i);
Timeline* timeline = loadTimelineFromProtocolBuffers(timelineProtobuf);
if (timeline)
action->addTimeline(timeline);
}
_animationActions.insert(fileName, action);
return action;
}
Timeline* ActionTimelineCache::loadTimeline(const rapidjson::Value& json)
@ -342,7 +421,7 @@ Frame* ActionTimelineCache::loadTextureFrame(const rapidjson::Value& json)
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(path);
if(spriteFrame == nullptr)
{
std::string jsonPath = NodeReader::getInstance()->getJsonPath();
std::string jsonPath = CSLoader::getInstance()->getJsonPath();
path = jsonPath + texture;
}
@ -372,6 +451,819 @@ Frame* ActionTimelineCache::loadZOrderFrame(const rapidjson::Value& json)
return frame;
}
Timeline* ActionTimelineCache::loadTimelineFromProtocolBuffers(const protocolbuffers::TimeLine &timelineProtobuf)
{
Timeline* timeline = NULL;
// get frame type
const char* frameType = timelineProtobuf.frametype().c_str();
if(frameType == NULL)
return NULL;
CCLOG("frameType = %s", frameType);
if(frameType)
{
timeline = Timeline::create();
int actionTag = timelineProtobuf.actiontag();
timeline->setActionTag(actionTag);
int length = timelineProtobuf.frames_size();
for (int i = 0; i < length; i++)
{
const protocolbuffers::Frame& frameProtobuf = timelineProtobuf.frames(i);
Frame* frame = NULL;
if (strcmp(FrameType_VisibleFrame, frameType) == 0)
{
const protocolbuffers::TimeLineBoolFrame& visibleFrame = frameProtobuf.visibleframe();
frame = loadVisibleFrameFromProtocolBuffers(visibleFrame);
}
else if (strcmp(FrameType_PositionFrame, frameType) == 0)
{
const protocolbuffers::TimeLinePointFrame& positionFrame = frameProtobuf.positionframe();
frame = loadPositionFrameFromProtocolBuffers(positionFrame);
}
else if (strcmp(FrameType_ScaleFrame, frameType) == 0)
{
const protocolbuffers::TimeLinePointFrame& scaleFrame = frameProtobuf.scaleframe();
frame = loadScaleFrameFromProtocolBuffers(scaleFrame);
}
else if (strcmp(FrameType_RotationSkewFrame, frameType) == 0)
{
const protocolbuffers::TimeLinePointFrame& rotationSkewFrame = frameProtobuf.rotationskewframe();
frame = loadRotationSkewFrameFromProtocolBuffers(rotationSkewFrame);
}
else if (strcmp(FrameType_AnchorFrame, frameType) == 0)
{
const protocolbuffers::TimeLinePointFrame& anchorFrame = frameProtobuf.anchorpointframe();
frame = loadAnchorPointFrameFromProtocolBuffers(anchorFrame);
}
else if (strcmp(FrameType_ColorFrame, frameType) == 0)
{
const protocolbuffers::TimeLineColorFrame& colorFrame = frameProtobuf.colorframe();
frame = loadColorFrameFromProtocolBuffers(colorFrame);
}
else if (strcmp(FrameType_TextureFrame, frameType) == 0)
{
const protocolbuffers::TimeLineTextureFrame& textureFrame = frameProtobuf.textureframe();
frame = loadTextureFrameFromProtocolBuffers(textureFrame);
}
else if (strcmp(FrameType_EventFrame, frameType) == 0)
{
const protocolbuffers::TimeLineStringFrame& eventFrame = frameProtobuf.eventframe();
frame = loadEventFrameFromProtocolBuffers(eventFrame);
}
else if (strcmp(FrameType_ZOrderFrame, frameType) == 0)
{
const protocolbuffers::TimeLineIntFrame& zOrderFrame = frameProtobuf.zorderframe();
frame = loadZOrderFrameFromProtocolBuffers(zOrderFrame);
}
timeline->addFrame(frame);
}
}
return timeline;
}
Frame* ActionTimelineCache::loadVisibleFrameFromProtocolBuffers(const protocolbuffers::TimeLineBoolFrame &frameProtobuf)
{
VisibleFrame* frame = VisibleFrame::create();
bool visible = frameProtobuf.value();
frame->setVisible(visible);
CCLOG("visible = %d", visible);
int frameIndex = frameProtobuf.has_frameindex() ? frameProtobuf.frameindex() : 0;
frame->setFrameIndex(frameIndex);
bool tween = (frameProtobuf.has_tween() ? frameProtobuf.tween() : false);
frame->setTween(tween);
return frame;
}
Frame* ActionTimelineCache::loadPositionFrameFromProtocolBuffers(const protocolbuffers::TimeLinePointFrame &frameProtobuf)
{
PositionFrame* frame = PositionFrame::create();
float x = frameProtobuf.x();
float y = frameProtobuf.y();
frame->setPosition(Vec2(x,y));
CCLOG("x = %f", x);
CCLOG("y = %f", y);
int frameIndex = frameProtobuf.has_frameindex() ? frameProtobuf.frameindex() : 0;
frame->setFrameIndex(frameIndex);
bool tween = (frameProtobuf.has_tween() ? frameProtobuf.tween() : false);
frame->setTween(tween);
return frame;
}
Frame* ActionTimelineCache::loadScaleFrameFromProtocolBuffers(const protocolbuffers::TimeLinePointFrame &frameProtobuf)
{
ScaleFrame* frame = ScaleFrame::create();
float scalex = frameProtobuf.x();
float scaley = frameProtobuf.y();
frame->setScaleX(scalex);
frame->setScaleY(scaley);
CCLOG("scalex = %f", scalex);
CCLOG("scaley = %f", scaley);
int frameIndex = frameProtobuf.has_frameindex() ? frameProtobuf.frameindex() : 0;
frame->setFrameIndex(frameIndex);
bool tween = (frameProtobuf.has_tween() ? frameProtobuf.tween() : false);
frame->setTween(tween);
return frame;
}
Frame* ActionTimelineCache::loadRotationSkewFrameFromProtocolBuffers(const protocolbuffers::TimeLinePointFrame &frameProtobuf)
{
RotationSkewFrame* frame = RotationSkewFrame::create();
float skewx = frameProtobuf.x();
float skewy = frameProtobuf.y();
frame->setSkewX(skewx);
frame->setSkewY(skewy);
int frameIndex = frameProtobuf.has_frameindex() ? frameProtobuf.frameindex() : 0;
frame->setFrameIndex(frameIndex);
bool tween = (frameProtobuf.has_tween() ? frameProtobuf.tween() : false);
frame->setTween(tween);
return frame;
}
Frame* ActionTimelineCache::loadAnchorPointFrameFromProtocolBuffers(const protocolbuffers::TimeLinePointFrame &frameProtobuf)
{
AnchorPointFrame* frame = AnchorPointFrame::create();
float anchorx = frameProtobuf.x();
float anchory = frameProtobuf.y();
frame->setAnchorPoint(Vec2(anchorx, anchory));
CCLOG("anchorx = %f", anchorx);
CCLOG("anchory = %f", anchory);
int frameIndex = frameProtobuf.has_frameindex() ? frameProtobuf.frameindex() : 0;
frame->setFrameIndex(frameIndex);
bool tween = (frameProtobuf.has_tween() ? frameProtobuf.tween() : false);
frame->setTween(tween);
return frame;
}
Frame* ActionTimelineCache::loadColorFrameFromProtocolBuffers(const protocolbuffers::TimeLineColorFrame &frameProtobuf)
{
ColorFrame* frame = ColorFrame::create();
GLubyte alpha = (GLubyte)frameProtobuf.alpha();
GLubyte red = (GLubyte)frameProtobuf.red();
GLubyte green = (GLubyte)frameProtobuf.green();
GLubyte blue = (GLubyte)frameProtobuf.blue();
frame->setAlpha(alpha);
frame->setColor(Color3B(red, green, blue));
CCLOG("alpha = %d", alpha);
CCLOG("red = %d", red);
CCLOG("green = %d", green);
CCLOG("blue = %d", blue);
int frameIndex = frameProtobuf.has_frameindex() ? frameProtobuf.frameindex() : 0;
frame->setFrameIndex(frameIndex);
bool tween = (frameProtobuf.has_tween() ? frameProtobuf.tween() : false);
frame->setTween(tween);
return frame;
}
Frame* ActionTimelineCache::loadTextureFrameFromProtocolBuffers(const protocolbuffers::TimeLineTextureFrame &frameProtobuf)
{
TextureFrame* frame = TextureFrame::create();
const char* texture = frameProtobuf.filepath().c_str();
if (texture != NULL)
frame->setTextureName(texture);
CCLOG("texture = %s", texture);
int frameIndex = frameProtobuf.has_frameindex() ? frameProtobuf.frameindex() : 0;
frame->setFrameIndex(frameIndex);
bool tween = (frameProtobuf.has_tween() ? frameProtobuf.tween() : false);
frame->setTween(tween);
return frame;
}
Frame* ActionTimelineCache::loadEventFrameFromProtocolBuffers(const protocolbuffers::TimeLineStringFrame &frameProtobuf)
{
EventFrame* frame = EventFrame::create();
const char* evnt = frameProtobuf.value().c_str();
if (evnt != NULL)
frame->setEvent(evnt);
CCLOG("evnt = %s", evnt);
int frameIndex = frameProtobuf.has_frameindex() ? frameProtobuf.frameindex() : 0;
frame->setFrameIndex(frameIndex);
bool tween = (frameProtobuf.has_tween() ? frameProtobuf.tween() : false);
frame->setTween(tween);
return frame;
}
Frame* ActionTimelineCache::loadZOrderFrameFromProtocolBuffers(const protocolbuffers::TimeLineIntFrame &frameProtobuf)
{
ZOrderFrame* frame = ZOrderFrame::create();
int zorder = frameProtobuf.value();
frame->setZOrder(zorder);
CCLOG("zorder = %d", zorder);
int frameIndex = frameProtobuf.has_frameindex() ? frameProtobuf.frameindex() : 0;
frame->setFrameIndex(frameIndex);
bool tween = (frameProtobuf.has_tween() ? frameProtobuf.tween() : false);
frame->setTween(tween);
return frame;
}
ActionTimeline* ActionTimelineCache::createActionFromXML(const std::string &fileName)
{
ActionTimeline* action = _animationActions.at(fileName);
if (action == nullptr)
{
action = loadAnimationActionWithFileFromXML(fileName);
}
return action->clone();
}
ActionTimeline* ActionTimelineCache::loadAnimationActionWithFileFromXML(const std::string &fileName)
{
// if already exists an action with filename, then return this action
ActionTimeline* action = _animationActions.at(fileName);
if (action)
return action;
// Read content from file
// xml read
std::string fullpath = FileUtils::getInstance()->fullPathForFilename(fileName).c_str();
ssize_t size;
std::string content =(char*)FileUtils::getInstance()->getFileData(fullpath, "r", &size);
// xml parse
tinyxml2::XMLDocument* document = new tinyxml2::XMLDocument();
document->Parse(content.c_str());
const tinyxml2::XMLElement* rootElement = document->RootElement();// Root
CCLOG("rootElement name = %s", rootElement->Name());
const tinyxml2::XMLElement* element = rootElement->FirstChildElement();
bool createEnabled = false;
std::string rootType = "";
while (element)
{
CCLOG("entity name = %s", element->Name());
if (strcmp("Content", element->Name()) == 0)
{
const tinyxml2::XMLAttribute* attribute = element->FirstAttribute();
if (!attribute)
{
createEnabled = true;
}
}
if (createEnabled)
{
break;
}
const tinyxml2::XMLElement* child = element->FirstChildElement();
if (child)
{
element = child;
}
else
{
element = element->NextSiblingElement();
}
}
// serialize
if (createEnabled)
{
const tinyxml2::XMLElement* child = element->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "Animation") // action
{
const tinyxml2::XMLElement* animation = child;
action = loadActionTimelineFromXML(animation);
}
child = child->NextSiblingElement();
}
}
return action;
}
ActionTimeline* ActionTimelineCache::loadActionTimelineFromXML(const tinyxml2::XMLElement *animationElement)
{
ActionTimeline* action = ActionTimeline::create();
CCLOG("animationElement name = %s", animationElement->Name());
// ActionTimeline
const tinyxml2::XMLAttribute* attribute = animationElement->FirstAttribute();
// attibutes
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Duration")
{
action->setDuration(atoi(value.c_str()));
}
else if (name == "Speed")
{
action->setTimeSpeed(atof(value.c_str()));
}
attribute = attribute->Next();
}
// all Timeline
const tinyxml2::XMLElement* timelineElement = animationElement->FirstChildElement();
while (timelineElement)
{
Timeline* timeline = loadTimelineFromXML(timelineElement);
if (timeline)
{
action->addTimeline(timeline);
}
// protocolbuffers::TimeLine* timeLine = nodeAction->add_timelines();
// convertTimelineProtocolBuffers(timeLine, timelineElement);
timelineElement = timelineElement->NextSiblingElement();
}
return action;
}
Timeline* ActionTimelineCache::loadTimelineFromXML(const tinyxml2::XMLElement *timelineElement)
{
Timeline* timeline = nullptr;
// TimelineData attrsibutes
int actionTag = 0;
std::string frameType = "";
const tinyxml2::XMLAttribute* attribute = timelineElement->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "ActionTag")
{
actionTag = atoi(value.c_str());
}
else if (name == "FrameType")
{
frameType = value;
}
attribute = attribute->Next();
}
if (frameType != "")
{
timeline = Timeline::create();
timeline->setActionTag(actionTag);
}
// all Frame
const tinyxml2::XMLElement* frameElement = timelineElement->FirstChildElement();
while (frameElement)
{
Frame* frame = nullptr;
if (frameType == FrameType_VisibleFrame)
{
frame = loadVisibleFrameFromXML(frameElement);
}
else if (frameType == FrameType_PositionFrame)
{
frame = loadPositionFrameFromXML(frameElement);
}
else if (frameType == FrameType_ScaleFrame)
{
frame = loadScaleFrameFromXML(frameElement);
}
else if (frameType == FrameType_RotationSkewFrame)
{
frame = loadRotationSkewFrameFromXML(frameElement);
}
else if (frameType == FrameType_AnchorFrame)
{
frame = loadAnchorPointFrameFromXML(frameElement);
}
else if (frameType == FrameType_ColorFrame)
{
frame = loadColorFrameFromXML(frameElement);
}
else if (frameType == FrameType_TextureFrame)
{
frame = loadTextureFrameFromXML(frameElement);
}
else if (frameType == FrameType_EventFrame)
{
frame = loadEventFrameFromXML(frameElement);
}
else if (frameType == FrameType_ZOrderFrame)
{
frame = loadZOrderFrameFromXML(frameElement);
}
if (frame)
{
timeline->addFrame(frame);
}
frameElement = frameElement->NextSiblingElement();
}
return timeline;
}
Frame* ActionTimelineCache::loadVisibleFrameFromXML(const tinyxml2::XMLElement *frameElement)
{
VisibleFrame* frame = VisibleFrame::create();
frame->setTween(true);
const tinyxml2::XMLAttribute* attribute = frameElement->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Value")
{
frame->setVisible((value == "True") ? true : false);
}
else if (name == "FrameIndex")
{
frame->setFrameIndex(atoi(value.c_str()));
}
else if (name == "Tween")
{
frame->setTween((value == "True") ? true : false);
}
attribute = attribute->Next();
}
return frame;
}
Frame* ActionTimelineCache::loadPositionFrameFromXML(const tinyxml2::XMLElement *frameElement)
{
PositionFrame* frame = PositionFrame::create();
frame->setTween(true);
const tinyxml2::XMLAttribute* attribute = frameElement->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
frame->setX(atof(value.c_str()));
}
else if (name == "Y")
{
frame->setY(atof(value.c_str()));
}
else if (name == "FrameIndex")
{
frame->setFrameIndex(atoi(value.c_str()));
}
else if (name == "Tween")
{
frame->setTween((value == "True") ? true : false);
}
attribute = attribute->Next();
}
return frame;
}
Frame* ActionTimelineCache::loadScaleFrameFromXML(const tinyxml2::XMLElement *frameElement)
{
ScaleFrame* frame = ScaleFrame::create();
frame->setTween(true);
const tinyxml2::XMLAttribute* attribute = frameElement->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
frame->setScaleX(atof(value.c_str()));
}
else if (name == "Y")
{
frame->setScaleY(atof(value.c_str()));
}
else if (name == "FrameIndex")
{
frame->setFrameIndex(atoi(value.c_str()));
}
else if (name == "Tween")
{
frame->setTween((value == "True") ? true : false);
}
attribute = attribute->Next();
}
return frame;
}
Frame* ActionTimelineCache::loadRotationSkewFrameFromXML(const tinyxml2::XMLElement *frameElement)
{
RotationSkewFrame* frame = RotationSkewFrame::create();
frame->setTween(true);
const tinyxml2::XMLAttribute* attribute = frameElement->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
frame->setSkewX(atof(value.c_str()));
}
else if (name == "Y")
{
frame->setSkewY(atof(value.c_str()));
}
else if (name == "FrameIndex")
{
frame->setFrameIndex(atoi(value.c_str()));
}
else if (name == "Tween")
{
frame->setTween((value == "True") ? true : false);
}
attribute = attribute->Next();
}
return frame;
}
Frame* ActionTimelineCache::loadAnchorPointFrameFromXML(const tinyxml2::XMLElement *frameElement)
{
AnchorPointFrame* frame = AnchorPointFrame::create();
float anchor_x = 0.5f, anchor_y = 0.5f;
frame->setTween(true);
const tinyxml2::XMLAttribute* attribute = frameElement->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
anchor_x = atof(value.c_str());
}
else if (name == "Y")
{
anchor_y = atof(value.c_str());
}
else if (name == "FrameIndex")
{
frame->setFrameIndex(atoi(value.c_str()));
}
else if (name == "Tween")
{
frame->setTween((value == "True") ? true : false);
}
attribute = attribute->Next();
}
frame->setAnchorPoint(Vec2(anchor_x, anchor_y));
return frame;
}
Frame* ActionTimelineCache::loadColorFrameFromXML(const tinyxml2::XMLElement *frameElement)
{
ColorFrame* frame = ColorFrame::create();
int red = 255, green = 255, blue = 255;
frame->setTween(true);
const tinyxml2::XMLAttribute* attribute = frameElement->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "FrameIndex")
{
frame->setFrameIndex(atoi(value.c_str()));
}
else if (name == "Alpha")
{
frame->setAlpha(atoi(value.c_str()));
}
else if (name == "Tween")
{
frame->setTween((value == "True") ? true : false);
}
attribute = attribute->Next();
}
// color
const tinyxml2::XMLElement* child = frameElement->FirstChildElement();
while (child)
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
red = atoi(value.c_str());
}
else if (name == "G")
{
green = atoi(value.c_str());
}
else if (name == "B")
{
blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
child = child->NextSiblingElement();
}
frame->setColor(Color3B(red, green, blue));
return frame;
}
Frame* ActionTimelineCache::loadTextureFrameFromXML(const tinyxml2::XMLElement *frameElement)
{
TextureFrame* frame = TextureFrame::create();
frame->setTween(true);
const tinyxml2::XMLAttribute* attribute = frameElement->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path") // to be gonna modify
{
frame->setTextureName(value);
}
else if (name == "FrameIndex")
{
frame->setFrameIndex(atoi(value.c_str()));
}
else if (name == "Tween")
{
frame->setTween((value == "True") ? true : false);
}
attribute = attribute->Next();
}
return frame;
}
Frame* ActionTimelineCache::loadEventFrameFromXML(const tinyxml2::XMLElement *frameElement)
{
EventFrame* frame = EventFrame::create();
frame->setTween(true);
const tinyxml2::XMLAttribute* attribute = frameElement->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "EventStr") // to be gonna modify
{
frame->setEvent(value);
}
else if (name == "FrameIndex")
{
frame->setFrameIndex(atoi(value.c_str()));
}
else if (name == "Tween")
{
frame->setTween((value == "True") ? true : false);
}
attribute = attribute->Next();
}
return frame;
}
Frame* ActionTimelineCache::loadZOrderFrameFromXML(const tinyxml2::XMLElement *frameElement)
{
ZOrderFrame* frame = ZOrderFrame::create();
frame->setTween(true);
const tinyxml2::XMLAttribute* attribute = frameElement->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "zorder") // to be gonna modify
{
frame->setZOrder(atoi(value.c_str()));
}
else if (name == "FrameIndex")
{
frame->setFrameIndex(atoi(value.c_str()));
}
else if (name == "Tween")
{
frame->setTween((value == "True") ? true : false);
}
attribute = attribute->Next();
}
return frame;
}
}
}

View File

@ -32,6 +32,24 @@ THE SOFTWARE.
#include "CCTimelineMacro.h"
#include "cocostudio/CocosStudioExport.h"
namespace protocolbuffers
{
class NodeAction;
class TimeLine;
class Frame;
class TimeLineBoolFrame;
class TimeLinePointFrame;
class TimeLineIntFrame;
class TimeLineColorFrame;
class TimeLineTextureFrame;
class TimeLineStringFrame;
}
namespace tinyxml2
{
class XMLElement;
}
NS_TIMELINE_BEGIN
class ActionTimeline;
@ -53,12 +71,22 @@ public:
/** Remove action with filename, and also remove other resource relate with this file */
void removeAction(const std::string& fileName);
static ActionTimeline* createAction(const std::string& fileName);
/** Clone a action with the specified name from the container. */
ActionTimeline* createAction(const std::string& fileName);
ActionTimeline* createActionFromJson(const std::string& fileName);
ActionTimeline* loadAnimationActionWithFile(const std::string& fileName);
ActionTimeline* loadAnimationActionWithContent(const std::string&fileName, const std::string& content);
ActionTimeline* createActionFromProtocolBuffers(const std::string& fileName);
ActionTimeline* loadAnimationActionWithFileFromProtocolBuffers(const std::string& fileName);
ActionTimeline* createActionFromXML(const std::string& fileName);
ActionTimeline* loadAnimationActionWithFileFromXML(const std::string& fileName);
ActionTimeline* loadActionTimelineFromXML(const tinyxml2::XMLElement* animationElement);
protected:
Timeline* loadTimeline(const rapidjson::Value& json);
@ -75,6 +103,30 @@ protected:
Frame* loadTextureFrame (const rapidjson::Value& json);
Frame* loadEventFrame (const rapidjson::Value& json);
Frame* loadZOrderFrame (const rapidjson::Value& json);
Timeline* loadTimelineFromProtocolBuffers(const protocolbuffers::TimeLine& timelineProtobuf);
Frame* loadVisibleFrameFromProtocolBuffers (const protocolbuffers::TimeLineBoolFrame& frameProtobuf);
Frame* loadPositionFrameFromProtocolBuffers (const protocolbuffers::TimeLinePointFrame& frameProtobuf);
Frame* loadScaleFrameFromProtocolBuffers (const protocolbuffers::TimeLinePointFrame& frameProtobuf);
Frame* loadRotationSkewFrameFromProtocolBuffers(const protocolbuffers::TimeLinePointFrame& frameProtobuf);
Frame* loadAnchorPointFrameFromProtocolBuffers (const protocolbuffers::TimeLinePointFrame& frameProtobuf);
Frame* loadColorFrameFromProtocolBuffers (const protocolbuffers::TimeLineColorFrame& frameProtobuf);
Frame* loadTextureFrameFromProtocolBuffers (const protocolbuffers::TimeLineTextureFrame& frameProtobuf);
Frame* loadEventFrameFromProtocolBuffers (const protocolbuffers::TimeLineStringFrame& frameProtobuf);
Frame* loadZOrderFrameFromProtocolBuffers (const protocolbuffers::TimeLineIntFrame& frameProtobuf);
Timeline* loadTimelineFromXML(const tinyxml2::XMLElement* timelineElement);
Frame* loadVisibleFrameFromXML (const tinyxml2::XMLElement* frameElement);
Frame* loadPositionFrameFromXML (const tinyxml2::XMLElement* frameElement);
Frame* loadScaleFrameFromXML (const tinyxml2::XMLElement* frameElement);
Frame* loadRotationSkewFrameFromXML(const tinyxml2::XMLElement* frameElement);
Frame* loadAnchorPointFrameFromXML (const tinyxml2::XMLElement* frameElement);
Frame* loadColorFrameFromXML (const tinyxml2::XMLElement* frameElement);
Frame* loadTextureFrameFromXML (const tinyxml2::XMLElement* frameElement);
Frame* loadEventFrameFromXML (const tinyxml2::XMLElement* frameElement);
Frame* loadZOrderFrameFromXML (const tinyxml2::XMLElement* frameElement);
protected:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,203 @@
/****************************************************************************
Copyright (c) 2013 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __cocos2d_libs__CSLoader__
#define __cocos2d_libs__CSLoader__
#include "cocostudio/DictionaryHelper.h"
#include "cocostudio/CocosStudioExport.h"
#include "cocos2d.h"
namespace protocolbuffers
{
class NodeTree;
class WidgetOptions;
class SpriteOptions;
class ProjectNodeOptions;
class ParticleSystemOptions;
class TMXTiledMapOptions;
class ComponentOptions;
class ComAudioOptions;
}
namespace tinyxml2
{
class XMLElement;
}
namespace cocostudio
{
class ComAudio;
}
namespace cocostudio
{
namespace timeline
{
class ActionTimeline;
}
}
NS_CC_BEGIN
class CC_STUDIO_DLL CSLoader
{
public:
static CSLoader* getInstance();
static void destroyInstance();
CSLoader();
void purge();
void init();
static cocos2d::Node* createNode(const std::string& filename);
static cocostudio::timeline::ActionTimeline* createTimeline(const std::string& filename);
cocos2d::Node* createNodeFromJson(const std::string& filename);
cocos2d::Node* loadNodeWithFile(const std::string& fileName);
cocos2d::Node* loadNodeWithContent(const std::string& content);
void setRecordJsonPath(bool record) { _recordJsonPath = record; }
bool isRecordJsonPath() const { return _recordJsonPath; }
void setJsonPath(std::string jsonPath) { _jsonPath = jsonPath; }
std::string getJsonPath() const { return _jsonPath; }
cocos2d::Node* createNodeFromProtocolBuffers(const std::string& filename);
cocos2d::Node* nodeFromProtocolBuffersFile(const std::string& fileName);
cocos2d::Node* nodeFromProtocolBuffers(const protocolbuffers::NodeTree& nodetree);
void setRecordProtocolBuffersPath(bool record) { _recordProtocolBuffersPath = record; }
bool isRecordProtocolBuffersPath() const { return _recordProtocolBuffersPath; }
void setProtocolBuffersPath(std::string protocolBuffersPath) { _protocolBuffersPath = protocolBuffersPath; }
std::string getProtocolBuffersPath() const { return _protocolBuffersPath; }
cocos2d::Node* createNodeFromXML(const std::string& filename);
cocos2d::Node* nodeFromXMLFile(const std::string& fileName);
cocos2d::Node* nodeFromXML(const tinyxml2::XMLElement* objectData,
const std::string& classType);
void setRecordXMLPath(bool record) { _recordXMLPath = record; }
bool isRecordXMLPath() const { return _recordXMLPath; }
void setXMLPath(std::string xmlPath) { _xmlPath = xmlPath; }
std::string getXMLPath() const { return _xmlPath; }
protected:
cocos2d::Node* loadNode(const rapidjson::Value& json);
void locateNodeWithMulresPosition(cocos2d::Node* node, const rapidjson::Value& json);
void initNode(cocos2d::Node* node, const rapidjson::Value& json);
// load nodes
cocos2d::Node* loadSimpleNode(const rapidjson::Value& json);
cocos2d::Node* loadSubGraph (const rapidjson::Value& json);
cocos2d::Node* loadSprite (const rapidjson::Value& json);
cocos2d::Node* loadParticle (const rapidjson::Value& json);
cocos2d::Node* loadTMXTiledMap(const rapidjson::Value& json);
// load gui
cocos2d::Node* loadWidget(const rapidjson::Value& json);
// load component
cocos2d::Component* loadComponent(const rapidjson::Value& json);
cocos2d::Component* loadComAudio(const rapidjson::Value& json);
void setPropsForNodeFromProtocolBuffers(cocos2d::Node* node, const protocolbuffers::WidgetOptions& nodeOptions);
void setPropsForSingleNodeFromProtocolBuffers(cocos2d::Node* node, const protocolbuffers::WidgetOptions& nodeOptions);
void setPropsForSpriteFromProtocolBuffers(cocos2d::Node* node,
const protocolbuffers::SpriteOptions& spriteOptions,
const protocolbuffers::WidgetOptions& nodeOptions);
cocos2d::Node* createParticleFromProtocolBuffers(const protocolbuffers::ParticleSystemOptions& particleSystemOptions,
const protocolbuffers::WidgetOptions& nodeOptions);
cocos2d::Node* createTMXTiledMapFromProtocolBuffers(const protocolbuffers::TMXTiledMapOptions& tmxTiledMapOptions,
const protocolbuffers::WidgetOptions& nodeOptions);
void setPropsForProjectNodeFromProtocolBuffers(cocos2d::Node* node,
const protocolbuffers::ProjectNodeOptions& projectNodeOptions,
const protocolbuffers::WidgetOptions& nodeOptions);
void setPropsForSimpleAudioFromProtocolBuffers(cocos2d::Node* node, const protocolbuffers::WidgetOptions& nodeOptions);
cocos2d::Component* createComponentFromProtocolBuffers(const protocolbuffers::ComponentOptions& componentOptions);
void setPropsForComponentFromProtocolBuffers(cocos2d::Component* component, const protocolbuffers::ComponentOptions& componentOptions);
void setPropsForComAudioFromProtocolBuffers(cocos2d::Component* component,
const protocolbuffers::ComAudioOptions& comAudioOptions);
void setPropsForNodeFromXML(cocos2d::Node* node,
const tinyxml2::XMLElement* nodeObjectData);
void setPropsForSingleNodeFromXML(cocos2d::Node* node,
const tinyxml2::XMLElement* nodeObjectData);
void setPropsForSpriteFromXML(cocos2d::Node* node,
const tinyxml2::XMLElement* spriteObjectData);
cocos2d::Node* createParticleFromXML(const tinyxml2::XMLElement* particleObjectData);
cocos2d::Node* createTMXTiledMapFromXML(const tinyxml2::XMLElement* tmxTiledMapObjectData);
void setPropsForProjectNodeFromXML(cocos2d::Node* node,
const tinyxml2::XMLElement* projectNodeObjectData);
void setPropsForSimpleAudioFromXML(cocos2d::Node* node,
const tinyxml2::XMLElement* simpleAudioObjectData);
cocos2d::Component* createComponentFromXML(const tinyxml2::XMLElement* componentObjectData,
const std::string& componentType);
void setPropsForComponentFromXML(cocos2d::Component* component,
const tinyxml2::XMLElement* componentObjectData);
void setPropsForComAudioFromXML(cocos2d::Component* component,
const tinyxml2::XMLElement* comAudioObjectData);
bool isWidget(const std::string& type);
bool isCustomWidget(const std::string& type);
std::string getGUIClassName(const std::string &name);
std::string getWidgetReaderClassName(cocos2d::ui::Widget *widget);
typedef std::function<cocos2d::Node*(const rapidjson::Value& json)> NodeCreateFunc;
typedef std::pair<std::string, NodeCreateFunc> Pair;
std::unordered_map<std::string, NodeCreateFunc> _funcs;
typedef std::function<cocos2d::Component*(const rapidjson::Value& json)> ComponentCreateFunc;
typedef std::pair<std::string, ComponentCreateFunc> ComponentPair;
std::unordered_map<std::string, ComponentCreateFunc> _componentFuncs;
bool _recordJsonPath;
std::string _jsonPath;
bool _recordProtocolBuffersPath;
std::string _protocolBuffersPath;
bool _recordXMLPath;
std::string _xmlPath;
std::string _monoCocos2dxVersion;
};
NS_CC_END
#endif /* defined(__cocos2d_libs__CSLoader__) */

View File

@ -58,13 +58,18 @@ ActionTimeline/CCNodeReader.cpp \
ActionTimeline/CCActionTimelineCache.cpp \
ActionTimeline/CCFrame.cpp \
ActionTimeline/CCTimeLine.cpp \
ActionTimeline/CCActionTimeline.cpp
ActionTimeline/CCActionTimeline.cpp \
ActionTimeline/CSLoader.cpp \
CSParseBinary.pb.cc
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../../../external
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../.. \
$(LOCAL_PATH)/../../../external \
$(LOCAL_PATH)/../../../external/protobuf-lite/src/google/protobuf \
$(LOCAL_PATH)/../../../external/protobuf-lite/src \
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../.. \
$(LOCAL_PATH)/WidgetReader \
@ -77,6 +82,7 @@ LOCAL_STATIC_LIBRARIES := cocos_ui_static
LOCAL_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_STATIC_LIBRARIES += cocos_extension_static
LOCAL_STATIC_LIBRARIES += cocos2dx_internal_static
LOCAL_STATIC_LIBRARIES += cocos_protobuf-lite_static
include $(BUILD_STATIC_LIBRARY)

View File

@ -40,6 +40,9 @@ THE SOFTWARE.
#include "WidgetReader/ScrollViewReader/ScrollViewReader.h"
#include "WidgetReader/ListViewReader/ListViewReader.h"
#include "cocostudio/CocoLoader.h"
#include "ui/CocosGUI.h"
#include "CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
using namespace cocos2d;
using namespace cocos2d::ui;
@ -358,7 +361,8 @@ Widget* GUIReader::widgetFromBinaryFile(const char *fileName)
{
std::string jsonpath;
rapidjson::Document jsonDict;
jsonpath = CCFileUtils::getInstance()->fullPathForFilename(fileName);
jsonpath = fileName;
// jsonpath = CCFileUtils::getInstance()->fullPathForFilename(fileName);
size_t pos = jsonpath.find_last_of('/');
m_strFilePath = jsonpath.substr(0,pos+1);
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName);
@ -1540,4 +1544,243 @@ void WidgetPropertiesReader0300::setPropsForAllCustomWidgetFromJsonDictionary(co
}
}
Widget* WidgetPropertiesReader0300::widgetFromProtocolBuffers(const protocolbuffers::NodeTree &nodetree)
{
std::string classname = nodetree.classname();
CCLOG("classname = %s", classname.c_str());
Widget* widget = this->createGUI(classname);
std::string readerName = this->getWidgetReaderClassName(classname);
WidgetReaderProtocol* reader = this->createWidgetReaderProtocol(readerName);
if (reader)
{
// widget parse with widget reader
setPropsForAllWidgetFromProtocolBuffers(reader, widget, nodetree);
}
else
{
//
// 1st., custom widget parse properties of parent widget with parent widget reader
readerName = this->getWidgetReaderClassName(widget);
reader = this->createWidgetReaderProtocol(readerName);
if (reader && widget)
{
setPropsForAllWidgetFromProtocolBuffers(reader, widget, nodetree);
// 2nd., custom widget parse with custom reader
const protocolbuffers::WidgetOptions& widgetOptions = nodetree.widgetoptions();
const char* customProperty = widgetOptions.customproperty().c_str();
rapidjson::Document customJsonDict;
customJsonDict.Parse<0>(customProperty);
if (customJsonDict.HasParseError())
{
CCLOG("GetParseError %s\n", customJsonDict.GetParseError());
}
setPropsForAllCustomWidgetFromJsonDictionary(classname, widget, customJsonDict);
}
else
{
CCLOG("Widget or WidgetReader doesn't exists!!! Please check your json file.");
}
//
}
int size = nodetree.children_size();
CCLOG("widget children size = %d", size);
for (int i = 0; i < size; ++i)
{
protocolbuffers::NodeTree subNodeTree = nodetree.children(i);
Widget* child = widgetFromProtocolBuffers(subNodeTree);
CCLOG("widget child = %p", child);
if (child)
{
PageView* pageView = dynamic_cast<PageView*>(widget);
if (pageView)
{
pageView->addPage(static_cast<Layout*>(child));
}
else
{
ListView* listView = dynamic_cast<ListView*>(widget);
if (listView)
{
listView->pushBackCustomItem(child);
}
else
{
widget->addChild(child);
}
}
}
}
CCLOG("widget = %p", widget);
return widget;
}
void WidgetPropertiesReader0300::setPropsForAllWidgetFromProtocolBuffers(cocostudio::WidgetReaderProtocol *reader, cocos2d::ui::Widget *widget, const protocolbuffers::NodeTree &nodetree)
{
reader->setPropsFromProtocolBuffers(widget, nodetree);
}
Widget* WidgetPropertiesReader0300::widgetFromXML(const tinyxml2::XMLElement *objectData, const std::string &classType)
{
std::string classname = classType.substr(0, classType.find("ObjectData"));
CCLOG("classname = %s", classname.c_str());
Widget* widget = this->createGUI(classname);
std::string readerName = this->getWidgetReaderClassName(classname);
WidgetReaderProtocol* reader = this->createWidgetReaderProtocol(readerName);
if (reader)
{
// widget parse with widget reader
setPropsForAllWidgetFromXML(reader, widget, objectData);
}
else
{
//
// 1st., custom widget parse properties of parent widget with parent widget reader
readerName = this->getWidgetReaderClassName(widget);
reader = this->createWidgetReaderProtocol(readerName);
if (reader && widget)
{
setPropsForAllWidgetFromXML(reader, widget, objectData);
// 2nd., custom widget parse with custom reader
// const protocolbuffers::WidgetOptions& widgetOptions = nodetree.widgetoptions();
// const char* customProperty = widgetOptions.customproperty().c_str();
const char* customProperty = "";
rapidjson::Document customJsonDict;
customJsonDict.Parse<0>(customProperty);
if (customJsonDict.HasParseError())
{
CCLOG("GetParseError %s\n", customJsonDict.GetParseError());
}
setPropsForAllCustomWidgetFromJsonDictionary(classname, widget, customJsonDict);
}
else
{
CCLOG("Widget or WidgetReader doesn't exists!!! Please check your json file.");
}
//
}
// children
bool containChildrenElement = false;
objectData = objectData->FirstChildElement();
while (objectData)
{
CCLOG("objectData name = %s", objectData->Name());
if (strcmp("Children", objectData->Name()) == 0)
{
containChildrenElement = true;
break;
}
objectData = objectData->NextSiblingElement();
}
if (containChildrenElement)
{
objectData = objectData->FirstChildElement();
CCLOG("objectData name = %s", objectData->Name());
while (objectData)
{
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "ctype")
{
Widget* child = widgetFromXML(objectData, value);
CCLOG("child = %p", child);
if (child)
{
PageView* pageView = dynamic_cast<PageView*>(widget);
ListView* listView = dynamic_cast<ListView*>(widget);
if (pageView)
{
Layout* layout = dynamic_cast<Layout*>(child);
if (layout)
{
pageView->addPage(layout);
}
}
else if (listView)
{
Widget* widgetChild = dynamic_cast<Widget*>(child);
if (widgetChild)
{
listView->pushBackCustomItem(widgetChild);
}
}
else
{
widget->addChild(child);
}
}
break;
}
attribute = attribute->Next();
}
// Node* child = nodeFromXML(objectData, value);
// CCLOG("child = %p", child);
// if (child)
// {
// PageView* pageView = dynamic_cast<PageView*>(node);
// ListView* listView = dynamic_cast<ListView*>(node);
// if (pageView)
// {
// Layout* layout = dynamic_cast<Layout*>(child);
// if (layout)
// {
// pageView->addPage(layout);
// }
// }
// else if (listView)
// {
// Widget* widget = dynamic_cast<Widget*>(child);
// if (widget)
// {
// listView->pushBackCustomItem(widget);
// }
// }
// else
// {
// node->addChild(child);
// }
// }
objectData = objectData->NextSiblingElement();
}
}
//
CCLOG("widget = %p", widget);
return widget;
}
void WidgetPropertiesReader0300::setPropsForAllWidgetFromXML(cocostudio::WidgetReaderProtocol *reader, cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
reader->setPropsFromXML(widget, objectData);
}
}

View File

@ -31,6 +31,16 @@ THE SOFTWARE.
#include "base/ObjectFactory.h"
#include "cocostudio/CocosStudioExport.h"
namespace protocolbuffers
{
class NodeTree;
}
namespace tinyxml2
{
class XMLElement;
}
namespace cocostudio {
class CocoLoader;
@ -116,6 +126,16 @@ public:
CocoLoader* cocoLoader,
stExpCocoNode* pCocoNode) = 0;
virtual cocos2d::ui::Widget* widgetFromProtocolBuffers(const protocolbuffers::NodeTree& nodetree) = 0;
virtual void setPropsForAllWidgetFromProtocolBuffers(WidgetReaderProtocol* reader,
cocos2d::ui::Widget* widget,
const protocolbuffers::NodeTree& nodetree) = 0;
virtual cocos2d::ui::Widget* widgetFromXML(const tinyxml2::XMLElement* objectData, const std::string& classType) = 0;
virtual void setPropsForAllWidgetFromXML(WidgetReaderProtocol* reader,
cocos2d::ui::Widget* widget,
const tinyxml2::XMLElement* objectData) = 0;
protected:
void setAnchorPointForWidget(cocos2d::ui::Widget* widget, const rapidjson::Value&options);
std::string getWidgetReaderClassName(const std::string& classname);
@ -175,6 +195,16 @@ public:
virtual void setPropsForAllCustomWidgetFromJsonDictionary(const std::string& classType,
cocos2d::ui::Widget* widget,
const rapidjson::Value& customOptions);
virtual cocos2d::ui::Widget* widgetFromProtocolBuffers(const protocolbuffers::NodeTree& nodetree) { return NULL; };
virtual void setPropsForAllWidgetFromProtocolBuffers(WidgetReaderProtocol* reader,
cocos2d::ui::Widget* widget,
const protocolbuffers::NodeTree& nodetree) {};
virtual cocos2d::ui::Widget* widgetFromXML(const tinyxml2::XMLElement* objectData, const std::string& classType) { return nullptr; };
virtual void setPropsForAllWidgetFromXML(WidgetReaderProtocol* reader,
cocos2d::ui::Widget* widget,
const tinyxml2::XMLElement* objectData) {};
};
class CC_STUDIO_DLL WidgetPropertiesReader0300 : public WidgetPropertiesReader
@ -219,6 +249,16 @@ public:
virtual void setPropsForAllCustomWidgetFromJsonDictionary(const std::string& classType,
cocos2d::ui::Widget* widget,
const rapidjson::Value& customOptions);
virtual cocos2d::ui::Widget* widgetFromProtocolBuffers(const protocolbuffers::NodeTree& nodetree);
virtual void setPropsForAllWidgetFromProtocolBuffers(WidgetReaderProtocol* reader,
cocos2d::ui::Widget* widget,
const protocolbuffers::NodeTree& nodetree);
virtual cocos2d::ui::Widget* widgetFromXML(const tinyxml2::XMLElement* objectData, const std::string& classType);
virtual void setPropsForAllWidgetFromXML(WidgetReaderProtocol* reader,
cocos2d::ui::Widget* widget,
const tinyxml2::XMLElement* objectData);
};

View File

@ -58,9 +58,9 @@ set(COCOS_CS_SRC
editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.cpp
editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp
editor-support/cocostudio/ActionTimeline/CCFrame.cpp
editor-support/cocostudio/ActionTimeline/CCNodeReader.cpp
editor-support/cocostudio/ActionTimeline/CCTimeLine.cpp
editor-support/cocostudio/ActionTimeline/CSLoader.cpp
editor-support/cocostudio/CSParseBinary.pb.cc
)
include_directories( editor-support )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -58,11 +58,11 @@ THE SOFTWARE.
#include "cocostudio/CCSGUIReader.h"
#include "cocostudio/CCSSceneReader.h"
#include "cocostudio/TriggerBase.h"
#include "cocostudio/ActionTimeline/CCNodeReader.h"
#include "cocostudio/ActionTimeline/CCActionTimelineCache.h"
#include "cocostudio/ActionTimeline/CCFrame.h"
#include "cocostudio/ActionTimeline/CCTimeLine.h"
#include "cocostudio/ActionTimeline/CCActionTimeline.h"
#include "cocostudio/CocosStudioExport.h"
#include "cocostudio/ActionTimeline/CSLoader.h"
#endif

View File

@ -3,6 +3,8 @@
#include "ButtonReader.h"
#include "ui/UIButton.h"
#include "cocostudio/CocoLoader.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
USING_NS_CC;
using namespace ui;
@ -232,4 +234,460 @@ namespace cocostudio
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
}
void ButtonReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);
Button* button = static_cast<Button*>(widget);
const protocolbuffers::ButtonOptions& options = nodeTree.buttonoptions();
std::string protocolBuffersPath = GUIReader::getInstance()->getFilePath();;
bool scale9Enable = options.scale9enable();
button->setScale9Enabled(scale9Enable);
const protocolbuffers::ResourceData& normalDic = options.normaldata();
int normalType = normalDic.resourcetype();
if (normalType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + normalDic.plistfile());
}
std::string normalTexturePath = this->getResourcePath(normalDic.path(), (Widget::TextureResType)normalType);
button->loadTextureNormal(normalTexturePath, (Widget::TextureResType)normalType);
const protocolbuffers::ResourceData& pressedDic = options.presseddata();
int pressedType = pressedDic.resourcetype();
if (pressedType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + pressedDic.plistfile());
}
std::string pressedTexturePath = this->getResourcePath(pressedDic.path(), (Widget::TextureResType)pressedType);
button->loadTexturePressed(pressedTexturePath, (Widget::TextureResType)pressedType);
const protocolbuffers::ResourceData& disabledDic = options.disableddata();
int disabledType = disabledDic.resourcetype();
if (disabledType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + disabledDic.plistfile());
}
std::string disabledTexturePath = this->getResourcePath(disabledDic.path(), (Widget::TextureResType)disabledType);
button->loadTextureDisabled(disabledTexturePath, (Widget::TextureResType)disabledType);
if (scale9Enable)
{
button->setUnifySizeEnabled(false);
button->ignoreContentAdaptWithSize(false);
float cx = options.capinsetsx();
float cy = options.capinsetsy();
float cw = options.capinsetswidth();
float ch = options.capinsetsheight();
button->setCapInsets(Rect(cx, cy, cw, ch));
bool sw = options.has_scale9width();
bool sh = options.has_scale9height();
if (sw && sh)
{
float swf = options.scale9width();
float shf = options.scale9height();
button->setContentSize(Size(swf, shf));
}
}
bool tt = options.has_text();
if (tt)
{
const char* text = options.text().c_str();
if (text)
{
button->setTitleText(text);
}
}
int cri = options.has_textcolorr() ? options.textcolorr() : 255;
int cgi = options.has_textcolorg() ? options.textcolorg() : 255;
int cbi = options.has_textcolorb() ? options.textcolorb() : 255;
button->setTitleColor(Color3B(cri,cgi,cbi));
int fontSize = options.has_fontsize() ? options.fontsize() : 14;
button->setTitleFontSize(fontSize);
bool displaystate = true;
if(options.has_displaystate())
{
displaystate = options.displaystate();
}
button->setBright(displaystate);
const char* fontName = options.has_fontname() ? options.fontname().c_str() : "微软雅黑";
button->setTitleFontName(fontName);
if (options.has_fontresource())
{
const protocolbuffers::ResourceData& resourceData = options.fontresource();
button->setTitleFontName(protocolBuffersPath + resourceData.path());
}
const protocolbuffers::WidgetOptions& widgetOption = nodeTree.widgetoptions();
button->setColor(Color3B(widgetOption.colorr(), widgetOption.colorg(), widgetOption.colorb()));
button->setOpacity(widgetOption.has_alpha() ? widgetOption.alpha() : 255);
// other commonly protperties
WidgetReader::setColorPropsFromProtocolBuffers(widget, nodeTree);
}
void ButtonReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
WidgetReader::setPropsFromXML(widget, objectData);
Button* button = static_cast<Button*>(widget);
std::string xmlPath = GUIReader::getInstance()->getFilePath();
bool scale9Enabled = false;
float cx = 0.0f, cy = 0.0f, cw = 0.0f, ch = 0.0f;
float swf = 0.0f, shf = 0.0f;
std::string text = "";
std::string fontName = "微软雅黑";
int fontSize = 0;
int title_color_red = 255, title_color_green = 255, title_color_blue = 255;
int cri = 255, cgi = 255, cbi = 255;
int opacity = 255;
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Scale9Enable")
{
if (value == "True")
{
scale9Enabled = true;
}
}
else if (name == "Scale9OriginX")
{
cx = atof(value.c_str());
}
else if (name == "Scale9OriginY")
{
cy = atof(value.c_str());
}
else if (name == "Scale9Width")
{
cw = atof(value.c_str());
}
else if (name == "Scale9Height")
{
ch = atof(value.c_str());
}
else if (name == "ButtonText")
{
text = value;
}
else if (name == "FontSize")
{
fontSize = atoi(value.c_str());
}
else if (name == "FontName")
{
fontName = value;
}
else if (name == "Alpha")
{
opacity = atoi(value.c_str());
}
else if (name == "DisplayState")
{
button->setBright((value == "True") ? true : false);
}
attribute = attribute->Next();
}
// child elements
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "Size" && scale9Enabled)
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
swf = atof(value.c_str());
}
else if (name == "Y")
{
shf = atof(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "CColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
cri = atoi(value.c_str());
}
else if (name == "G")
{
cgi = atoi(value.c_str());
}
else if (name == "B")
{
cbi = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "TextColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
title_color_red = atoi(value.c_str());
}
else if (name == "G")
{
title_color_green = atoi(value.c_str());
}
else if (name == "B")
{
title_color_blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "DisabledFileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
button->loadTextureDisabled(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
button->loadTextureDisabled(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
else if (name == "PressedFileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
button->loadTexturePressed(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
button->loadTexturePressed(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
else if (name == "NormalFileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
button->loadTextureNormal(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
button->loadTextureNormal(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
else if (name == "FontResource")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
fontName = xmlPath + path;
break;
}
default:
break;
}
}
child = child->NextSiblingElement();
}
button->setScale9Enabled(scale9Enabled);
if (scale9Enabled)
{
button->setUnifySizeEnabled(false);
button->ignoreContentAdaptWithSize(false);
button->setCapInsets(Rect(cx, cy, cw, ch));
button->setContentSize(Size(swf, shf));
}
button->setTitleText(text);
button->setTitleColor(Color3B(title_color_red, title_color_green, title_color_blue));
button->setTitleFontSize(fontSize);
button->setTitleFontName(fontName);
button->setColor(Color3B(cri,cgi,cbi));
button->setOpacity(opacity);
}
}

View File

@ -45,6 +45,10 @@ namespace cocostudio
const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode);
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
};
}

View File

@ -3,6 +3,8 @@
#include "CheckBoxReader.h"
#include "ui/UICheckBox.h"
#include "cocostudio/CocoLoader.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
USING_NS_CC;
using namespace ui;
@ -150,4 +152,362 @@ namespace cocostudio
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
}
void CheckBoxReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);
CheckBox* checkBox = static_cast<CheckBox*>(widget);
const protocolbuffers::CheckBoxOptions& options = nodeTree.checkboxoptions();
std::string protocolBuffersPath = GUIReader::getInstance()->getFilePath();
//load background image
const protocolbuffers::ResourceData& backGroundDic = options.backgroundboxdata();
int backGroundType = backGroundDic.resourcetype();
if (backGroundType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + backGroundDic.plistfile());
}
std::string backGroundTexturePath = this->getResourcePath(backGroundDic.path(), (Widget::TextureResType)backGroundType);
checkBox->loadTextureBackGround(backGroundTexturePath, (Widget::TextureResType)backGroundType);
//load background selected image
const protocolbuffers::ResourceData& backGroundSelectedDic = options.backgroundboxselecteddata();
int backGroundSelectedType = backGroundSelectedDic.resourcetype();
if (backGroundSelectedType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + backGroundSelectedDic.plistfile());
}
std::string backGroundSelectedTexturePath = this->getResourcePath(backGroundSelectedDic.path(), (Widget::TextureResType)backGroundSelectedType);
checkBox->loadTextureBackGroundSelected(backGroundSelectedTexturePath, (Widget::TextureResType)backGroundSelectedType);
//load frontCross image
const protocolbuffers::ResourceData& frontCrossDic = options.frontcrossdata();
int frontCrossType = frontCrossDic.resourcetype();
if (frontCrossType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + frontCrossDic.plistfile());
}
std::string frontCrossFileName = this->getResourcePath(frontCrossDic.path(), (Widget::TextureResType)frontCrossType);
checkBox->loadTextureFrontCross(frontCrossFileName, (Widget::TextureResType)frontCrossType);
//load backGroundBoxDisabledData
const protocolbuffers::ResourceData& backGroundDisabledDic = options.backgroundboxdisableddata();
int backGroundDisabledType = backGroundDisabledDic.resourcetype();
if (backGroundDisabledType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + backGroundDisabledDic.plistfile());
}
std::string backGroundDisabledFileName = this->getResourcePath(backGroundDisabledDic.path(), (Widget::TextureResType)backGroundDisabledType);
checkBox->loadTextureBackGroundDisabled(backGroundDisabledFileName, (Widget::TextureResType)backGroundDisabledType);
///load frontCrossDisabledData
const protocolbuffers::ResourceData& frontCrossDisabledDic = options.frontcrossdisableddata();
int frontCrossDisabledType = frontCrossDisabledDic.resourcetype();
if (frontCrossDisabledType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + frontCrossDisabledDic.plistfile());
}
std::string frontCrossDisabledFileName = this->getResourcePath(frontCrossDisabledDic.path(), (Widget::TextureResType)frontCrossDisabledType);
checkBox->loadTextureFrontCrossDisabled(frontCrossDisabledFileName, (Widget::TextureResType)frontCrossDisabledType);
checkBox->setSelectedState(options.selectedstate());
bool displaystate = true;
if(options.has_displaystate())
{
displaystate = options.displaystate();
}
checkBox->setBright(displaystate);
// other commonly protperties
WidgetReader::setColorPropsFromProtocolBuffers(widget, nodeTree);
}
void CheckBoxReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
WidgetReader::setPropsFromXML(widget, objectData);
CheckBox* checkBox = static_cast<CheckBox*>(widget);
std::string xmlPath = GUIReader::getInstance()->getFilePath();
int opacity = 255;
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "CheckedState")
{
checkBox->setSelectedState((value == "True") ? true : false);
}
else if (name == "DisplayState")
{
checkBox->setBright((value == "True") ? true : false);
}
else if (name == "Alpha")
{
opacity = atoi(value.c_str());
}
attribute = attribute->Next();
}
// child elements
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "NormalBackFileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = getResourceType(value);
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
checkBox->loadTextureBackGround(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
checkBox->loadTextureBackGround(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
else if (name == "PressedBackFileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = getResourceType(value);
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
checkBox->loadTextureBackGroundSelected(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
checkBox->loadTextureBackGroundSelected(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
else if (name == "NodeNormalFileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = getResourceType(value);
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
checkBox->loadTextureFrontCross(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
checkBox->loadTextureFrontCross(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
else if (name == "DisableBackFileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = getResourceType(value);
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
checkBox->loadTextureBackGroundDisabled(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
checkBox->loadTextureBackGroundDisabled(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
else if (name == "NodeDisableFileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = getResourceType(value);
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
checkBox->loadTextureFrontCrossDisabled(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
checkBox->loadTextureFrontCrossDisabled(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
child = child->NextSiblingElement();
}
checkBox->setOpacity(opacity);
}
int CheckBoxReader::getResourceType(std::string key)
{
if(key == "Normal" || key == "Default" || key == "MarkedSubImage")
{
return 0;
}
return 1;
}
}

View File

@ -43,6 +43,9 @@ namespace cocostudio
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode);
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
virtual int getResourceType(std::string key);
};
}

View File

@ -3,6 +3,8 @@
#include "ImageViewReader.h"
#include "ui/UIImageView.h"
#include "cocostudio/CocoLoader.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
USING_NS_CC;
using namespace ui;
@ -147,4 +149,204 @@ namespace cocostudio
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
}
void ImageViewReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);
const protocolbuffers::ImageViewOptions& options = nodeTree.imageviewoptions();
ImageView* imageView = static_cast<ImageView*>(widget);
std::string protocolBuffersPath = GUIReader::getInstance()->getFilePath();
const protocolbuffers::ResourceData& imageFileNameDic = options.filenamedata();
int imageFileNameType = imageFileNameDic.resourcetype();
if (imageFileNameType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + imageFileNameDic.plistfile());
}
std::string imageFileName = this->getResourcePath(imageFileNameDic.path(), (Widget::TextureResType)imageFileNameType);
imageView->loadTexture(imageFileName, (Widget::TextureResType)imageFileNameType);
bool scale9EnableExist = options.has_scale9enable();
bool scale9Enable = false;
if (scale9EnableExist)
{
scale9Enable = options.scale9enable();
}
imageView->setScale9Enabled(scale9Enable);
if (scale9Enable)
{
imageView->setUnifySizeEnabled(false);
imageView->ignoreContentAdaptWithSize(false);
float swf = options.has_scale9width() ? options.scale9width() : 80.0f;
float shf = options.has_scale9height() ? options.scale9height() : 80.0f;
imageView->setContentSize(Size(swf, shf));
float cx = options.capinsetsx();
float cy = options.capinsetsy();
float cw = options.has_capinsetswidth() ? options.capinsetswidth() : 1.0;
float ch = options.has_capinsetsheight() ? options.capinsetsheight() : 1.0;
imageView->setCapInsets(Rect(cx, cy, cw, ch));
}
// other commonly protperties
WidgetReader::setColorPropsFromProtocolBuffers(widget, nodeTree);
bool flipX = options.flippedx();
bool flipY = options.flippedy();
if(flipX != false)
imageView->setFlippedX(flipX);
if(flipY != false)
imageView->setFlippedY(flipY);
}
void ImageViewReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
WidgetReader::setPropsFromXML(widget, objectData);
ImageView* imageView = static_cast<ImageView*>(widget);
std::string xmlPath = GUIReader::getInstance()->getFilePath();
bool scale9Enabled = false;
float cx = 0.0f, cy = 0.0f, cw = 0.0f, ch = 0.0f;
float swf = 0.0f, shf = 0.0f;
int opacity = 255;
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Scale9Enable")
{
if (value == "True")
{
scale9Enabled = true;
}
}
else if (name == "Scale9OriginX")
{
cx = atof(value.c_str());
}
else if (name == "Scale9OriginY")
{
cy = atof(value.c_str());
}
else if (name == "Scale9Width")
{
cw = atof(value.c_str());
}
else if (name == "Scale9Height")
{
ch = atof(value.c_str());
}
else if (name == "Alpha")
{
opacity = atoi(value.c_str());
}
attribute = attribute->Next();
}
// child elements
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "Size" && scale9Enabled)
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
swf = atof(value.c_str());
}
else if (name == "Y")
{
shf = atof(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "FileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
imageView->loadTexture(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
imageView->loadTexture(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
child = child->NextSiblingElement();
}
imageView->setScale9Enabled(scale9Enabled);
if (scale9Enabled)
{
imageView->setCapInsets(Rect(cx, cy, cw, ch));
imageView->setContentSize(Size(swf, shf));
}
imageView->setOpacity(opacity);
}
}

View File

@ -43,6 +43,8 @@ namespace cocostudio
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode);
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
};
}

View File

@ -6,6 +6,8 @@
#include "ui/UIScrollView.h"
#include "ui/UIPageView.h"
#include "ui/UIListView.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
USING_NS_CC;
using namespace ui;
@ -301,4 +303,472 @@ namespace cocostudio
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
}
void LayoutReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);
Layout* panel = static_cast<Layout*>(widget);
const protocolbuffers::PanelOptions& options = nodeTree.paneloptions();
std::string protocolBuffersPath = GUIReader::getInstance()->getFilePath();
panel->setClippingEnabled(options.clipable());
bool backGroundScale9Enable = options.backgroundscale9enable();
panel->setBackGroundImageScale9Enabled(backGroundScale9Enable);
int cr;
int cg;
int cb;
int scr;
int scg;
int scb;
int ecr;
int ecg;
int ecb;
if (dynamic_cast<ui::PageView*>(widget))
{
cr = options.has_bgcolorr() ? options.bgcolorr() : 150;
cg = options.has_bgcolorg() ? options.bgcolorg() : 150;
cb = options.has_bgcolorb() ? options.bgcolorb() : 150;
scr = options.has_bgstartcolorr() ? options.bgstartcolorr() : 255;
scg = options.has_bgstartcolorg() ? options.bgstartcolorg() : 255;
scb = options.has_bgstartcolorb() ? options.bgstartcolorb() : 255;
ecr = options.has_bgendcolorr() ? options.bgendcolorr() : 255;
ecg = options.has_bgendcolorg() ? options.bgendcolorg() : 150;
ecb = options.has_bgendcolorb() ? options.bgendcolorb() : 100;
}
else if(dynamic_cast<ui::ListView*>(widget))
{
cr = options.has_bgcolorr() ? options.bgcolorr() : 150;
cg = options.has_bgcolorg() ? options.bgcolorg() : 150;
cb = options.has_bgcolorb() ? options.bgcolorb() : 255;
scr = options.has_bgstartcolorr() ? options.bgstartcolorr() : 255;
scg = options.has_bgstartcolorg() ? options.bgstartcolorg() : 255;
scb = options.has_bgstartcolorb() ? options.bgstartcolorb() : 255;
ecr = options.has_bgendcolorr() ? options.bgendcolorr() : 150;
ecg = options.has_bgendcolorg() ? options.bgendcolorg() : 150;
ecb = options.has_bgendcolorb() ? options.bgendcolorb() : 255;
}
else if(dynamic_cast<ui::ScrollView*>(widget))
{
cr = options.has_bgcolorr() ? options.bgcolorr() : 255;
cg = options.has_bgcolorg() ? options.bgcolorg() : 150;
cb = options.has_bgcolorb() ? options.bgcolorb() : 100;
scr = options.has_bgstartcolorr() ? options.bgstartcolorr() : 255;
scg = options.has_bgstartcolorg() ? options.bgstartcolorg() : 255;
scb = options.has_bgstartcolorb() ? options.bgstartcolorb() : 255;
ecr = options.has_bgendcolorr() ? options.bgendcolorr() : 255;
ecg = options.has_bgendcolorg() ? options.bgendcolorg() : 150;
ecb = options.has_bgendcolorb() ? options.bgendcolorb() : 100;
}
else
{
cr = options.has_bgcolorr() ? options.bgcolorr() : 150;
cg = options.has_bgcolorg() ? options.bgcolorg() : 200;
cb = options.has_bgcolorb() ? options.bgcolorb() : 255;
scr = options.has_bgstartcolorr() ? options.bgstartcolorr() : 255;
scg = options.has_bgstartcolorg() ? options.bgstartcolorg() : 255;
scb = options.has_bgstartcolorb() ? options.bgstartcolorb() : 255;
ecr = options.has_bgendcolorr() ? options.bgendcolorr() : 150;
ecg = options.has_bgendcolorg() ? options.bgendcolorg() : 200;
ecb = options.has_bgendcolorb() ? options.bgendcolorb() : 255;
}
float bgcv1 = 0.0f;
float bgcv2 = -0.5f;
if(options.has_vectorx())
{
bgcv1 = options.vectorx();
}
if(options.has_vectory())
{
bgcv2 = options.vectory();
}
panel->setBackGroundColorVector(Vec2(bgcv1, bgcv2));
int co = options.has_bgcoloropacity() ? options.bgcoloropacity() : 100;
int colorType = options.has_colortype() ? options.colortype() : 1;
panel->setBackGroundColorType(Layout::BackGroundColorType(colorType));
panel->setBackGroundColor(Color3B(scr, scg, scb),Color3B(ecr, ecg, ecb));
panel->setBackGroundColor(Color3B(cr, cg, cb));
panel->setBackGroundColorOpacity(co);
const protocolbuffers::ResourceData& imageFileNameDic = options.backgroundimagedata();
int imageFileNameType = imageFileNameDic.resourcetype();
if (imageFileNameType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + imageFileNameDic.plistfile());
}
std::string imageFileName = this->getResourcePath(imageFileNameDic.path(), (Widget::TextureResType)imageFileNameType);
panel->setBackGroundImage(imageFileName, (Widget::TextureResType)imageFileNameType);
if (backGroundScale9Enable)
{
float cx = options.capinsetsx();
float cy = options.capinsetsy();
float cw = options.has_capinsetswidth() ? options.capinsetswidth() : 1;
float ch = options.has_capinsetsheight() ? options.capinsetsheight() : 1;
panel->setBackGroundImageCapInsets(Rect(cx, cy, cw, ch));
bool sw = options.has_scale9width();
bool sh = options.has_scale9height();
if (sw && sh)
{
float swf = options.scale9width();
float shf = options.scale9height();
panel->setContentSize(Size(swf, shf));
}
}
panel->setLayoutType((Layout::Type)options.layouttype());
const protocolbuffers::WidgetOptions& widgetOptions = nodeTree.widgetoptions();
int red = widgetOptions.has_colorr() ? widgetOptions.colorr() : 255;
int green = widgetOptions.has_colorg() ? widgetOptions.colorg() : 255;
int blue = widgetOptions.has_colorb() ? widgetOptions.colorb() : 255;
panel->setColor(Color3B(red, green, blue));
int opacity = widgetOptions.has_alpha() ? widgetOptions.alpha() : 255;
panel->setOpacity(opacity);
// int bgimgcr = widgetOptions.has_colorr() ? widgetOptions.colorr() : 255;
// int bgimgcg = widgetOptions.has_colorg() ? widgetOptions.colorg() : 255;
// int bgimgcb = widgetOptions.has_colorb() ? widgetOptions.colorb() : 255;
// panel->setBackGroundImageColor(Color3B(bgimgcr, bgimgcg, bgimgcb));
//
// int bgimgopacity = widgetOptions.has_opacity() ? widgetOptions.opacity() : 255;
// panel->setBackGroundImageOpacity(bgimgopacity);
// other commonly protperties
setAnchorPointForWidget(widget, nodeTree);
bool flipX = widgetOptions.flipx();
bool flipY = widgetOptions.flipy();
widget->setFlippedX(flipX);
widget->setFlippedY(flipY);
}
void LayoutReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
WidgetReader::setPropsFromXML(widget, objectData);
Layout* panel = static_cast<Layout*>(widget);
std::string xmlPath = GUIReader::getInstance()->getFilePath();
bool scale9Enabled = false;
float width = 0.0f, height = 0.0f;
float cx = 0.0f, cy = 0.0f, cw = 0.0f, ch = 0.0f;
Layout::BackGroundColorType colorType = Layout::BackGroundColorType::NONE;
int color_opacity = 255, bgimg_opacity = 255, opacity = 255;
int red = 255, green = 255, blue = 255;
int bgimg_red = 255, bgimg_green = 255, bgimg_blue = 255;
int singleRed = 255, singleGreen = 255, singleBlue = 255;
int start_red = 255, start_green = 255, start_blue = 255;
int end_red = 255, end_green = 255, end_blue = 255;
float vector_color_x = 0.0f, vector_color_y = -0.5f;
int resourceType = 0;
std::string path = "", plistFile = "";
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "ClipAble")
{
panel->setClippingEnabled((value == "True") ? true : false);
}
else if (name == "ComboBoxIndex")
{
colorType = (Layout::BackGroundColorType)atoi(value.c_str());
}
else if (name == "BackColorAlpha")
{
color_opacity = atoi(value.c_str());
}
else if (name == "Alpha")
{
opacity = atoi(value.c_str());
bgimg_opacity = atoi(value.c_str());
}
else if (name == "Scale9Enable")
{
scale9Enabled = (value == "True") ? true : false;
}
else if (name == "Scale9OriginX")
{
cx = atof(value.c_str());
}
else if (name == "Scale9OriginY")
{
cy = atof(value.c_str());
}
else if (name == "Scale9Width")
{
cw = atof(value.c_str());
}
else if (name == "Scale9Height")
{
ch = atof(value.c_str());
}
attribute = attribute->Next();
}
// child elements
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "Size")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
width = atof(value.c_str());
}
else if (name == "Y")
{
height = atof(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "CColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
red = atoi(value.c_str());
bgimg_red = atoi(value.c_str());
}
else if (name == "G")
{
green = atoi(value.c_str());
bgimg_green = atoi(value.c_str());
}
else if (name == "B")
{
blue = atoi(value.c_str());
bgimg_blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "SingleColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
singleRed = atoi(value.c_str());
}
else if (name == "G")
{
singleGreen = atoi(value.c_str());
}
else if (name == "B")
{
singleBlue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "EndColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
end_red = atoi(value.c_str());
}
else if (name == "G")
{
end_green = atoi(value.c_str());
}
else if (name == "B")
{
end_blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "FirstColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
start_red = atoi(value.c_str());
}
else if (name == "G")
{
start_green = atoi(value.c_str());
}
else if (name == "B")
{
start_blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "ColorVector")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "ScaleX")
{
vector_color_x = atof(value.c_str());
}
else if (name == "ScaleY")
{
vector_color_y = atof(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "FileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
}
child = child->NextSiblingElement();
}
panel->setBackGroundColorType(colorType);
switch (colorType)
{
case Layout::BackGroundColorType::SOLID:
panel->setBackGroundColor(Color3B(singleRed, singleGreen, singleBlue));
break;
case Layout::BackGroundColorType::GRADIENT:
panel->setBackGroundColor(Color3B(start_red, start_green, start_blue),
Color3B(end_red, end_green, end_blue));
panel->setBackGroundColorVector(Vec2(vector_color_x, vector_color_y));
break;
default:
break;
}
panel->setColor(Color3B(red, green, blue));
panel->setOpacity(opacity);
panel->setBackGroundColorOpacity(color_opacity);
switch (resourceType)
{
case 0:
{
panel->setBackGroundImage(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
panel->setBackGroundImage(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
if (path != "")
{
if (scale9Enabled)
{
panel->setBackGroundImageScale9Enabled(scale9Enabled);
panel->setBackGroundImageCapInsets(Rect(cx, cy, cw, ch));
panel->setContentSize(Size(width, height));
}
}
// panel->setBackGroundImageColor(Color3B(bgimg_red, bgimg_green, bgimg_blue));
// panel->setBackGroundImageOpacity(bgimg_opacity);
}
}

View File

@ -43,6 +43,8 @@ namespace cocostudio
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ;
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
};
}

View File

@ -3,6 +3,8 @@
#include "ListViewReader.h"
#include "ui/UIListView.h"
#include "cocostudio/CocoLoader.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
USING_NS_CC;
using namespace ui;
@ -75,5 +77,532 @@ namespace cocostudio
float itemMargin = DICTOOL->getFloatValue_json(options, P_ItemMargin);
listView->setItemsMargin(itemMargin);
}
void ListViewReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);
ListView* listView = static_cast<ListView*>(widget);
const protocolbuffers::ListViewOptions& options = nodeTree.listviewoptions();
std::string protocolBuffersPath = GUIReader::getInstance()->getFilePath();
listView->setClippingEnabled(options.clipable());
bool backGroundScale9Enable = options.backgroundscale9enable();
listView->setBackGroundImageScale9Enabled(backGroundScale9Enable);
int cr;
int cg;
int cb;
int scr;
int scg;
int scb;
int ecr;
int ecg;
int ecb;
cr = options.has_bgcolorr() ? options.bgcolorr() : 150;
cg = options.has_bgcolorg() ? options.bgcolorg() : 150;
cb = options.has_bgcolorb() ? options.bgcolorb() : 255;
scr = options.has_bgstartcolorr() ? options.bgstartcolorr() : 255;
scg = options.has_bgstartcolorg() ? options.bgstartcolorg() : 255;
scb = options.has_bgstartcolorb() ? options.bgstartcolorb() : 255;
ecr = options.has_bgendcolorr() ? options.bgendcolorr() : 150;
ecg = options.has_bgendcolorg() ? options.bgendcolorg() : 150;
ecb = options.has_bgendcolorb() ? options.bgendcolorb() : 255;
float bgcv1 = options.vectorx();
float bgcv2 = options.has_vectory() ? options.vectory() : -0.5f;
listView->setBackGroundColorVector(Vec2(bgcv1, bgcv2));
int co = options.has_bgcoloropacity() ? options.bgcoloropacity() : 100;
int colorType = options.has_colortype() ? options.colortype() : 1;
listView->setBackGroundColorType(Layout::BackGroundColorType(colorType));
listView->setBackGroundColor(Color3B(scr, scg, scb),Color3B(ecr, ecg, ecb));
listView->setBackGroundColor(Color3B(cr, cg, cb));
listView->setBackGroundColorOpacity(co);
const protocolbuffers::ResourceData& imageFileNameDic = options.backgroundimagedata();
int imageFileNameType = imageFileNameDic.resourcetype();
if (imageFileNameType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + imageFileNameDic.plistfile());
}
std::string imageFileName = this->getResourcePath(imageFileNameDic.path(), (Widget::TextureResType)imageFileNameType);
listView->setBackGroundImage(imageFileName, (Widget::TextureResType)imageFileNameType);
if (backGroundScale9Enable)
{
float cx = options.capinsetsx();
float cy = options.capinsetsy();
float cw = options.has_capinsetswidth() ? options.capinsetswidth() : 1;
float ch = options.has_capinsetsheight() ? options.capinsetsheight() : 1;
listView->setBackGroundImageCapInsets(Rect(cx, cy, cw, ch));
bool sw = options.has_scale9width();
bool sh = options.has_scale9height();
if (sw && sh)
{
float swf = options.scale9width();
float shf = options.scale9height();
listView->setContentSize(Size(swf, shf));
}
}
const protocolbuffers::WidgetOptions& widgetOptions = nodeTree.widgetoptions();
int red = widgetOptions.has_colorr() ? widgetOptions.colorr() : 255;
int green = widgetOptions.has_colorg() ? widgetOptions.colorg() : 255;
int blue = widgetOptions.has_colorb() ? widgetOptions.colorb() : 255;
listView->setColor(Color3B(red, green, blue));
int opacity = widgetOptions.has_alpha() ? widgetOptions.alpha() : 255;
listView->setOpacity(opacity);
// int bgimgcr = widgetOptions.has_colorr() ? widgetOptions.colorr() : 255;
// int bgimgcg = widgetOptions.has_colorg() ? widgetOptions.colorg() : 255;
// int bgimgcb = widgetOptions.has_colorb() ? widgetOptions.colorb() : 255;
// listView->setBackGroundImageColor(Color3B(bgimgcr, bgimgcg, bgimgcb));
//
// int bgimgopacity = widgetOptions.has_opacity() ? widgetOptions.opacity() : 255;
// listView->setBackGroundImageOpacity(bgimgopacity);
float innerWidth = options.has_innerwidth() ? options.innerwidth() : 200;
float innerHeight = options.has_innerheight() ? options.innerheight() : 200;
listView->setInnerContainerSize(Size(innerWidth, innerHeight));
listView->setBounceEnabled(options.bounceenable());
int direction = options.has_direction() ? options.direction() : 2;
listView->setDirection((ScrollView::Direction)direction);
int gravityValue = options.has_gravity() ? options.gravity() : 3;
ListView::Gravity gravity = (ListView::Gravity)gravityValue;
listView->setGravity(gravity);
float itemMargin = options.itemmargin();
listView->setItemsMargin(itemMargin);
// other commonly protperties
setAnchorPointForWidget(widget, nodeTree);
bool flipX = widgetOptions.flipx();
bool flipY = widgetOptions.flipy();
widget->setFlippedX(flipX);
widget->setFlippedY(flipY);
}
void ListViewReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
WidgetReader::setPropsFromXML(widget, objectData);
ListView* listView = static_cast<ListView*>(widget);
std::string xmlPath = GUIReader::getInstance()->getFilePath();
bool scale9Enabled = false;
float width = 0.0f, height = 0.0f;
float cx = 0.0f, cy = 0.0f, cw = 0.0f, ch = 0.0f;
Layout::BackGroundColorType colorType = Layout::BackGroundColorType::NONE;
int color_opacity = 255, bgimg_opacity = 255, opacity = 255;
int red = 255, green = 255, blue = 255;
int bgimg_red = 255, bgimg_green = 255, bgimg_blue = 255;
int singleRed = 255, singleGreen = 255, singleBlue = 255;
int start_red = 255, start_green = 255, start_blue = 255;
int end_red = 255, end_green = 255, end_blue = 255;
float vector_color_x = 0.0f, vector_color_y = -0.5f;
int resourceType = 0;
std::string path = "", plistFile = "";
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "ClipAble")
{
listView->setClippingEnabled((value == "True") ? true : false);
}
else if (name == "ComboBoxIndex")
{
colorType = (Layout::BackGroundColorType)atoi(value.c_str());
}
else if (name == "BackColorAlpha")
{
color_opacity = atoi(value.c_str());
}
else if (name == "Alpha")
{
opacity = atoi(value.c_str());
bgimg_opacity = atoi(value.c_str());
}
else if (name == "Scale9Enable")
{
scale9Enabled = (value == "True") ? true : false;
}
else if (name == "Scale9OriginX")
{
cx = atof(value.c_str());
}
else if (name == "Scale9OriginY")
{
cy = atof(value.c_str());
}
else if (name == "Scale9Width")
{
cw = atof(value.c_str());
}
else if (name == "Scale9Height")
{
ch = atof(value.c_str());
}
else if (name == "DirectionType")
{
if (value == "Vertical")
{
listView->setDirection(ScrollView::Direction::VERTICAL);
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "HorizontalType")
{
if (value == "HORIZONTAL_LEFT")
{
listView->setGravity(ListView::Gravity::LEFT);
}
else if (value == "HORIZONTAL_RIGHT")
{
listView->setGravity(ListView::Gravity::RIGHT);
}
else if (value == "HORIZONTAL_CENTER")
{
listView->setGravity(ListView::Gravity::CENTER_HORIZONTAL);
}
}
attribute = attribute->Next();
}
}
else if (value == "Horizontal")
{
listView->setDirection(ScrollView::Direction::HORIZONTAL);
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "VerticalType")
{
if (value == "VERTICAL_TOP")
{
listView->setGravity(ListView::Gravity::TOP);
}
else if (value == "VERTICAL_BOTTOM")
{
listView->setGravity(ListView::Gravity::BOTTOM);
}
else if (value == "VERTICAL_CENTER")
{
listView->setGravity(ListView::Gravity::CENTER_VERTICAL);
}
}
attribute = attribute->Next();
}
}
}
else if (name == "IsBounceEnabled")
{
listView->setBounceEnabled((value == "True") ? true : false);
}
else if (name == "ItemMargin")
{
listView->setItemsMargin(atoi(value.c_str()));
}
attribute = attribute->Next();
}
// child elements
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "InnerNodeSize")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
float width = 0.0f, height = 0.0f;
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Width")
{
width = atof(value.c_str());
}
else if (name == "Height")
{
height = atof(value.c_str());
}
attribute = attribute->Next();
}
listView->setInnerContainerSize(Size(width, height));
}
else if (name == "Size")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
width = atof(value.c_str());
}
else if (name == "Y")
{
height = atof(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "CColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
red = atoi(value.c_str());
bgimg_red = atoi(value.c_str());
}
else if (name == "G")
{
green = atoi(value.c_str());
bgimg_green = atoi(value.c_str());
}
else if (name == "B")
{
blue = atoi(value.c_str());
bgimg_blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "SingleColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
singleRed = atoi(value.c_str());
}
else if (name == "G")
{
singleGreen = atoi(value.c_str());
}
else if (name == "B")
{
singleBlue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "EndColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
end_red = atoi(value.c_str());
}
else if (name == "G")
{
end_green = atoi(value.c_str());
}
else if (name == "B")
{
end_blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "FirstColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
start_red = atoi(value.c_str());
}
else if (name == "G")
{
start_green = atoi(value.c_str());
}
else if (name == "B")
{
start_blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "ColorVector")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "ScaleX")
{
vector_color_x = atof(value.c_str());
}
else if (name == "ScaleY")
{
vector_color_y = atof(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "FileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
}
child = child->NextSiblingElement();
}
listView->setColor(Color3B(red, green, blue));
listView->setOpacity(opacity);
listView->setBackGroundColorType(colorType);
switch (colorType)
{
case Layout::BackGroundColorType::SOLID:
listView->setBackGroundColor(Color3B(singleRed, singleGreen, singleBlue));
break;
case Layout::BackGroundColorType::GRADIENT:
listView->setBackGroundColor(Color3B(start_red, start_green, start_blue),
Color3B(end_red, end_green, end_blue));
listView->setBackGroundColorVector(Vec2(vector_color_x, vector_color_y));
break;
default:
break;
}
listView->setBackGroundColorOpacity(color_opacity);
switch (resourceType)
{
case 0:
{
listView->setBackGroundImage(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
listView->setBackGroundImage(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
if (path != "")
{
if (scale9Enabled)
{
listView->setBackGroundImageScale9Enabled(scale9Enabled);
listView->setBackGroundImageCapInsets(Rect(cx, cy, cw, ch));
listView->setContentSize(Size(width, height));
}
}
// listView->setBackGroundImageColor(Color3B(bgimg_red, bgimg_green, bgimg_blue));
// listView->setBackGroundImageOpacity(bgimg_opacity);
}
}

View File

@ -43,6 +43,9 @@ namespace cocostudio
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ;
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
};
}

View File

@ -3,6 +3,8 @@
#include "LoadingBarReader.h"
#include "ui/UILoadingBar.h"
#include "cocostudio/CocoLoader.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
USING_NS_CC;
using namespace ui;
@ -140,4 +142,180 @@ namespace cocostudio
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
}
void LoadingBarReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);
LoadingBar* loadingBar = static_cast<LoadingBar*>(widget);
const protocolbuffers::LoadingBarOptions& options = nodeTree.loadingbaroptions();
std::string protocolBuffersPath = GUIReader::getInstance()->getFilePath();
const protocolbuffers::ResourceData& imageFileNameDic = options.texturedata();
int imageFileNameType = imageFileNameDic.resourcetype();
if (imageFileNameType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + imageFileNameDic.plistfile());
}
std::string imageFileName = this->getResourcePath(imageFileNameDic.path(), (Widget::TextureResType)imageFileNameType);
loadingBar->loadTexture(imageFileName, (Widget::TextureResType)imageFileNameType);
/* gui mark add load bar scale9 parse */
bool scale9Enable = options.scale9enable();
loadingBar->setScale9Enabled(scale9Enable);
float cx = options.capinsetsx();
float cy = options.capinsetsy();
float cw = options.has_capinsetswidth() ? options.capinsetswidth() : 1;
float ch = options.has_capinsetsheight() ? options.capinsetsheight() : 1;
if (scale9Enable) {
loadingBar->setCapInsets(Rect(cx, cy, cw, ch));
}
const protocolbuffers::WidgetOptions& widgetOptions = nodeTree.widgetoptions();
float width = widgetOptions.width();
float height = widgetOptions.height();
loadingBar->setContentSize(Size(width, height));
/**/
loadingBar->setDirection(LoadingBar::Direction(options.direction()));
int percent = options.has_percent() ? options.percent() : 100;
loadingBar->setPercent(percent);
// other commonly protperties
WidgetReader::setColorPropsFromProtocolBuffers(widget, nodeTree);
}
void LoadingBarReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
WidgetReader::setPropsFromXML(widget, objectData);
LoadingBar* loadingBar = static_cast<LoadingBar*>(widget);
std::string xmlPath = GUIReader::getInstance()->getFilePath();
bool scale9Enabled = false;
float cx = 0.0f, cy = 0.0f, cw = 0.0f, ch = 0.0f;
float swf = 0.0f, shf = 0.0f;
int direction = 0;
int percent = 0;
int opacity = 255;
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "ProgressType")
{
direction = (value == "Left_To_Right") ? 0 : 1;
}
else if (name == "ProgressInfo")
{
percent = atoi(value.c_str());
}
else if (name == "Scale9Enable")
{
if (value == "True")
{
scale9Enabled = true;
}
}
else if (name == "Scale9OriginX")
{
cx = atof(value.c_str());
}
else if (name == "Scale9OriginY")
{
cy = atof(value.c_str());
}
else if (name == "Scale9Width")
{
cw = atof(value.c_str());
}
else if (name == "Scale9Height")
{
ch = atof(value.c_str());
}
else if (name == "Alpha")
{
opacity = atoi(value.c_str());
}
attribute = attribute->Next();
}
// child elements
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "ImageFileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
loadingBar->loadTexture(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
loadingBar->loadTexture(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
child = child->NextSiblingElement();
}
loadingBar->setDirection((LoadingBar::Direction)direction);
loadingBar->setPercent(percent);
loadingBar->setOpacity(opacity);
}
}

View File

@ -43,6 +43,9 @@ namespace cocostudio
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ;
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
};
}

View File

@ -4,6 +4,8 @@
#include "ui/UIPageView.h"
#include "ui/UILayout.h"
#include "cocostudio/CocoLoader.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
USING_NS_CC;
using namespace ui;
@ -42,4 +44,425 @@ namespace cocostudio
{
LayoutReader::setPropsFromJsonDictionary(widget, options);
}
void PageViewReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);
PageView* pageView = static_cast<PageView*>(widget);
const protocolbuffers::PageViewOptions& options = nodeTree.pageviewoptions();
std::string protocolBuffersPath = GUIReader::getInstance()->getFilePath();
CCLOG("options.clipable() = %d", options.clipable());
pageView->setClippingEnabled(options.clipable());
bool backGroundScale9Enable = options.backgroundscale9enable();
pageView->setBackGroundImageScale9Enabled(backGroundScale9Enable);
int cr;
int cg;
int cb;
int scr;
int scg;
int scb;
int ecr;
int ecg;
int ecb;
cr = options.has_bgcolorr() ? options.bgcolorr() : 150;
cg = options.has_bgcolorg() ? options.bgcolorg() : 150;
cb = options.has_bgcolorb() ? options.bgcolorb() : 150;
scr = options.has_bgstartcolorr() ? options.bgstartcolorr() : 255;
scg = options.has_bgstartcolorg() ? options.bgstartcolorg() : 255;
scb = options.has_bgstartcolorb() ? options.bgstartcolorb() : 255;
ecr = options.has_bgendcolorr() ? options.bgendcolorr() : 255;
ecg = options.has_bgendcolorg() ? options.bgendcolorg() : 150;
ecb = options.has_bgendcolorb() ? options.bgendcolorb() : 100;
float bgcv1 = 0.0f;
float bgcv2 = -0.5f;
if(options.has_vectorx())
{
bgcv1 = options.vectorx();
}
if(options.has_vectory())
{
bgcv2 = options.vectory();
}
pageView->setBackGroundColorVector(Vec2(bgcv1, bgcv2));
int co = options.has_bgcoloropacity() ? options.bgcoloropacity() : 100;
int colorType = options.has_colortype() ? options.colortype() : 1;
pageView->setBackGroundColorType(Layout::BackGroundColorType(colorType));
pageView->setBackGroundColor(Color3B(scr, scg, scb),Color3B(ecr, ecg, ecb));
pageView->setBackGroundColor(Color3B(cr, cg, cb));
pageView->setBackGroundColorOpacity(co);
const protocolbuffers::ResourceData& imageFileNameDic = options.backgroundimagedata();
int imageFileNameType = imageFileNameDic.resourcetype();
if (imageFileNameType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + imageFileNameDic.plistfile());
}
std::string imageFileName = this->getResourcePath(imageFileNameDic.path(), (Widget::TextureResType)imageFileNameType);
pageView->setBackGroundImage(imageFileName, (Widget::TextureResType)imageFileNameType);
if (backGroundScale9Enable)
{
float cx = options.capinsetsx();
float cy = options.capinsetsy();
float cw = options.has_capinsetswidth() ? options.capinsetswidth() : 1;
float ch = options.has_capinsetsheight() ? options.capinsetsheight() : 1;
pageView->setBackGroundImageCapInsets(Rect(cx, cy, cw, ch));
bool sw = options.has_scale9width();
bool sh = options.has_scale9height();
if (sw && sh)
{
float swf = options.scale9width();
float shf = options.scale9height();
pageView->setContentSize(Size(swf, shf));
}
}
const protocolbuffers::WidgetOptions& widgetOptions = nodeTree.widgetoptions();
int red = widgetOptions.has_colorr() ? widgetOptions.colorr() : 255;
int green = widgetOptions.has_colorg() ? widgetOptions.colorg() : 255;
int blue = widgetOptions.has_colorb() ? widgetOptions.colorb() : 255;
pageView->setColor(Color3B(red, green, blue));
int opacity = widgetOptions.has_alpha() ? widgetOptions.alpha() : 255;
pageView->setOpacity(opacity);
// int bgimgcr = widgetOptions.has_colorr() ? widgetOptions.colorr() : 255;
// int bgimgcg = widgetOptions.has_colorg() ? widgetOptions.colorg() : 255;
// int bgimgcb = widgetOptions.has_colorb() ? widgetOptions.colorb() : 255;
// pageView->setBackGroundImageColor(Color3B(bgimgcr, bgimgcg, bgimgcb));
//
// int bgimgopacity = widgetOptions.has_opacity() ? widgetOptions.opacity() : 255;
// pageView->setBackGroundImageOpacity(bgimgopacity);
// other commonly protperties
setAnchorPointForWidget(widget, nodeTree);
bool flipX = widgetOptions.flipx();
bool flipY = widgetOptions.flipy();
widget->setFlippedX(flipX);
widget->setFlippedY(flipY);
}
void PageViewReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
WidgetReader::setPropsFromXML(widget, objectData);
PageView* pageView = static_cast<PageView*>(widget);
std::string xmlPath = GUIReader::getInstance()->getFilePath();
bool scale9Enabled = false;
float width = 0.0f, height = 0.0f;
float cx = 0.0f, cy = 0.0f, cw = 0.0f, ch = 0.0f;
Layout::BackGroundColorType colorType = Layout::BackGroundColorType::NONE;
int color_opacity = 255, bgimg_opacity = 255, opacity = 255;
int red = 255, green = 255, blue = 255;
int bgimg_red = 255, bgimg_green = 255, bgimg_blue = 255;
int singleRed = 255, singleGreen = 255, singleBlue = 255;
int start_red = 255, start_green = 255, start_blue = 255;
int end_red = 255, end_green = 255, end_blue = 255;
float vector_color_x = 0.0f, vector_color_y = -0.5f;
int resourceType = 0;
std::string path = "", plistFile = "";
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "ClipAble")
{
pageView->setClippingEnabled((value == "True") ? true : false);
}
else if (name == "ComboBoxIndex")
{
colorType = (Layout::BackGroundColorType)atoi(value.c_str());
}
else if (name == "BackColorAlpha")
{
color_opacity = atoi(value.c_str());
}
else if (name == "Alpha")
{
opacity = atoi(value.c_str());
bgimg_opacity = atoi(value.c_str());
}
else if (name == "Scale9Enable")
{
scale9Enabled = (value == "True") ? true : false;
}
else if (name == "Scale9OriginX")
{
cx = atof(value.c_str());
}
else if (name == "Scale9OriginY")
{
cy = atof(value.c_str());
}
else if (name == "Scale9Width")
{
cw = atof(value.c_str());
}
else if (name == "Scale9Height")
{
ch = atof(value.c_str());
}
attribute = attribute->Next();
}
// child elements
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "Size")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
width = atof(value.c_str());
}
else if (name == "Y")
{
height = atof(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "CColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
red = atoi(value.c_str());
bgimg_red = atoi(value.c_str());
}
else if (name == "G")
{
green = atoi(value.c_str());
bgimg_green = atoi(value.c_str());
}
else if (name == "B")
{
blue = atoi(value.c_str());
bgimg_blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "SingleColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
singleRed = atoi(value.c_str());
}
else if (name == "G")
{
singleGreen = atoi(value.c_str());
}
else if (name == "B")
{
singleBlue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "EndColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
end_red = atoi(value.c_str());
}
else if (name == "G")
{
end_green = atoi(value.c_str());
}
else if (name == "B")
{
end_blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "FirstColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
start_red = atoi(value.c_str());
}
else if (name == "G")
{
start_green = atoi(value.c_str());
}
else if (name == "B")
{
start_blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "ColorVector")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "ScaleX")
{
vector_color_x = atof(value.c_str());
}
else if (name == "ScaleY")
{
vector_color_y = atof(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "FileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
}
child = child->NextSiblingElement();
}
pageView->setColor(Color3B(red, green, blue));
pageView->setOpacity(opacity);
pageView->setBackGroundColorType(colorType);
switch (colorType)
{
case Layout::BackGroundColorType::SOLID:
pageView->setBackGroundColor(Color3B(singleRed, singleGreen, singleBlue));
break;
case Layout::BackGroundColorType::GRADIENT:
pageView->setBackGroundColor(Color3B(start_red, start_green, start_blue),
Color3B(end_red, end_green, end_blue));
pageView->setBackGroundColorVector(Vec2(vector_color_x, vector_color_y));
break;
default:
break;
}
pageView->setBackGroundColorOpacity(color_opacity);
switch (resourceType)
{
case 0:
{
pageView->setBackGroundImage(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
pageView->setBackGroundImage(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
if (path != "")
{
if (scale9Enabled)
{
pageView->setBackGroundImageScale9Enabled(scale9Enabled);
pageView->setBackGroundImageCapInsets(Rect(cx, cy, cw, ch));
pageView->setContentSize(Size(width, height));
}
}
// pageView->setBackGroundImageColor(Color3B(bgimg_red, bgimg_green, bgimg_blue));
// pageView->setBackGroundImageOpacity(bgimg_opacity);
}
}

View File

@ -43,7 +43,8 @@ namespace cocostudio
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) ;
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
};
}

View File

@ -3,6 +3,8 @@
#include "ScrollViewReader.h"
#include "ui/UIScrollView.h"
#include "cocostudio/CocoLoader.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
USING_NS_CC;
using namespace ui;
@ -82,4 +84,484 @@ namespace cocostudio
LayoutReader::setColorPropsFromJsonDictionary(widget, options);
}
void ScrollViewReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);
ScrollView* scrollView = static_cast<ScrollView*>(widget);
const protocolbuffers::ScrollViewOptions& options = nodeTree.scrollviewoptions();
std::string protocolBuffersPath = GUIReader::getInstance()->getFilePath();
scrollView->setClippingEnabled(options.clipable());
bool backGroundScale9Enable = options.backgroundscale9enable();
scrollView->setBackGroundImageScale9Enabled(backGroundScale9Enable);
int cr;
int cg;
int cb;
int scr;
int scg;
int scb;
int ecr;
int ecg;
int ecb;
cr = options.has_bgcolorr() ? options.bgcolorr() : 255;
cg = options.has_bgcolorg() ? options.bgcolorg() : 150;
cb = options.has_bgcolorb() ? options.bgcolorb() : 100;
scr = options.has_bgstartcolorr() ? options.bgstartcolorr() : 255;
scg = options.has_bgstartcolorg() ? options.bgstartcolorg() : 255;
scb = options.has_bgstartcolorb() ? options.bgstartcolorb() : 255;
ecr = options.has_bgendcolorr() ? options.bgendcolorr() : 255;
ecg = options.has_bgendcolorg() ? options.bgendcolorg() : 150;
ecb = options.has_bgendcolorb() ? options.bgendcolorb() : 100;
float bgcv1 = 0.0f;
float bgcv2 = -0.5f;
if(options.has_vectorx())
{
bgcv1 = options.vectorx();
}
if(options.has_vectory())
{
bgcv2 = options.vectory();
}
scrollView->setBackGroundColorVector(Vec2(bgcv1, bgcv2));
int co = options.has_bgcoloropacity() ? options.bgcoloropacity() : 100;
int colorType = options.has_colortype() ? options.colortype() : 1;
scrollView->setBackGroundColorType(Layout::BackGroundColorType(colorType));
scrollView->setBackGroundColor(Color3B(scr, scg, scb),Color3B(ecr, ecg, ecb));
scrollView->setBackGroundColor(Color3B(cr, cg, cb));
scrollView->setBackGroundColorOpacity(co);
const protocolbuffers::ResourceData& imageFileNameDic = options.backgroundimagedata();
int imageFileNameType = imageFileNameDic.resourcetype();
if (imageFileNameType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + imageFileNameDic.plistfile());
}
std::string imageFileName = this->getResourcePath(imageFileNameDic.path(), (Widget::TextureResType)imageFileNameType);
scrollView->setBackGroundImage(imageFileName, (Widget::TextureResType)imageFileNameType);
if (backGroundScale9Enable)
{
float cx = options.capinsetsx();
float cy = options.capinsetsy();
float cw = options.has_capinsetswidth() ? options.capinsetswidth() : 1;
float ch = options.has_capinsetsheight() ? options.capinsetsheight() : 1;
scrollView->setBackGroundImageCapInsets(Rect(cx, cy, cw, ch));
bool sw = options.has_scale9width();
bool sh = options.has_scale9height();
if (sw && sh)
{
float swf = options.scale9width();
float shf = options.scale9height();
scrollView->setContentSize(Size(swf, shf));
}
}
scrollView->setLayoutType((Layout::Type)options.layouttype());
const protocolbuffers::WidgetOptions& widgetOptions = nodeTree.widgetoptions();
int red = widgetOptions.has_colorr() ? widgetOptions.colorr() : 255;
int green = widgetOptions.has_colorg() ? widgetOptions.colorg() : 255;
int blue = widgetOptions.has_colorb() ? widgetOptions.colorb() : 255;
scrollView->setColor(Color3B(red, green, blue));
int opacity = widgetOptions.has_alpha() ? widgetOptions.alpha() : 255;
scrollView->setOpacity(opacity);
// int bgimgcr = widgetOptions.has_colorr() ? widgetOptions.colorr() : 255;
// int bgimgcg = widgetOptions.has_colorg() ? widgetOptions.colorg() : 255;
// int bgimgcb = widgetOptions.has_colorb() ? widgetOptions.colorb() : 255;
// scrollView->setBackGroundImageColor(Color3B(bgimgcr, bgimgcg, bgimgcb));
//
// int bgimgopacity = widgetOptions.has_opacity() ? widgetOptions.opacity() : 255;
// scrollView->setBackGroundImageOpacity(bgimgopacity);
float innerWidth = options.has_innerwidth() ? options.innerwidth() : 200;
float innerHeight = options.has_innerheight() ? options.innerheight() : 200;
scrollView->setInnerContainerSize(Size(innerWidth, innerHeight));
int direction = options.has_direction() ? options.direction() : 1;
scrollView->setDirection((ScrollView::Direction)direction);
scrollView->setBounceEnabled(options.bounceenable());
// other commonly protperties
setAnchorPointForWidget(widget, nodeTree);
bool flipX = widgetOptions.flipx();
bool flipY = widgetOptions.flipy();
widget->setFlippedX(flipX);
widget->setFlippedY(flipY);
}
void ScrollViewReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
WidgetReader::setPropsFromXML(widget, objectData);
ScrollView* scrollView = static_cast<ScrollView*>(widget);
std::string xmlPath = GUIReader::getInstance()->getFilePath();
bool scale9Enabled = false;
float width = 0.0f, height = 0.0f;
float cx = 0.0f, cy = 0.0f, cw = 0.0f, ch = 0.0f;
Layout::BackGroundColorType colorType = Layout::BackGroundColorType::NONE;
int color_opacity = 255, bgimg_opacity = 255, opacity = 255;
int red = 255, green = 255, blue = 255;
int bgimg_red = 255, bgimg_green = 255, bgimg_blue = 255;
int singleRed = 255, singleGreen = 255, singleBlue = 255;
int start_red = 255, start_green = 255, start_blue = 255;
int end_red = 255, end_green = 255, end_blue = 255;
float vector_color_x = 0.0f, vector_color_y = -0.5f;
int direction = 1;
int resourceType = 0;
std::string path = "", plistFile = "";
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "ClipAble")
{
scrollView->setClippingEnabled((value == "True") ? true : false);
}
else if (name == "ComboBoxIndex")
{
colorType = (Layout::BackGroundColorType)atoi(value.c_str());
}
else if (name == "BackColorAlpha")
{
color_opacity = atoi(value.c_str());
}
else if (name == "Alpha")
{
opacity = atoi(value.c_str());
bgimg_opacity = atoi(value.c_str());
}
else if (name == "Scale9Enable")
{
scale9Enabled = (value == "True") ? true : false;
}
else if (name == "Scale9OriginX")
{
cx = atof(value.c_str());
}
else if (name == "Scale9OriginY")
{
cy = atof(value.c_str());
}
else if (name == "Scale9Width")
{
cw = atof(value.c_str());
}
else if (name == "Scale9Height")
{
ch = atof(value.c_str());
}
else if (name == "ScrollDirectionType")
{
if (value == "Vertical")
{
direction = 1;
}
else if (value == "Horizontal")
{
direction = 2;
}
else if (value == "Vertical_Horizontal")
{
direction = 3;
}
}
else if (name == "IsBounceEnabled")
{
scrollView->setBounceEnabled((value == "True") ? true : false);
}
attribute = attribute->Next();
}
// child elements
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "InnerNodeSize")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
float width = 0.0f, height = 0.0f;
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Width")
{
width = atof(value.c_str());
}
else if (name == "Height")
{
height = atof(value.c_str());
}
attribute = attribute->Next();
}
scrollView->setInnerContainerSize(Size(width, height));
}
else if (name == "Size")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
width = atof(value.c_str());
}
else if (name == "Y")
{
height = atof(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "CColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
red = atoi(value.c_str());
bgimg_red = atoi(value.c_str());
}
else if (name == "G")
{
green = atoi(value.c_str());
bgimg_green = atoi(value.c_str());
}
else if (name == "B")
{
blue = atoi(value.c_str());
bgimg_blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "SingleColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
singleRed = atoi(value.c_str());
}
else if (name == "G")
{
singleGreen = atoi(value.c_str());
}
else if (name == "B")
{
singleBlue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "EndColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
end_red = atoi(value.c_str());
}
else if (name == "G")
{
end_green = atoi(value.c_str());
}
else if (name == "B")
{
end_blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "FirstColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "R")
{
start_red = atoi(value.c_str());
}
else if (name == "G")
{
start_green = atoi(value.c_str());
}
else if (name == "B")
{
start_blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "ColorVector")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "ScaleX")
{
vector_color_x = atof(value.c_str());
}
else if (name == "ScaleY")
{
vector_color_y = atof(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "FileData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
}
child = child->NextSiblingElement();
}
scrollView->setColor(Color3B(red, green, blue));
scrollView->setOpacity(opacity);
scrollView->setBackGroundColorType(colorType);
switch (colorType)
{
case Layout::BackGroundColorType::SOLID:
scrollView->setBackGroundColor(Color3B(singleRed, singleGreen, singleBlue));
break;
case Layout::BackGroundColorType::GRADIENT:
scrollView->setBackGroundColor(Color3B(start_red, start_green, start_blue),
Color3B(end_red, end_green, end_blue));
scrollView->setBackGroundColorVector(Vec2(vector_color_x, vector_color_y));
break;
default:
break;
}
scrollView->setBackGroundColorOpacity(color_opacity);
switch (resourceType)
{
case 0:
{
scrollView->setBackGroundImage(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
scrollView->setBackGroundImage(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
if (path != "")
{
if (scale9Enabled)
{
scrollView->setBackGroundImageScale9Enabled(scale9Enabled);
scrollView->setBackGroundImageCapInsets(Rect(cx, cy, cw, ch));
scrollView->setContentSize(Size(width, height));
}
}
scrollView->setDirection((ScrollView::Direction)direction);
// scrollView->setBackGroundImageColor(Color3B(bgimg_red, bgimg_green, bgimg_blue));
// scrollView->setBackGroundImageOpacity(bgimg_opacity);
}
}

View File

@ -43,6 +43,8 @@ namespace cocostudio
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ;
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
};
}

View File

@ -3,6 +3,8 @@
#include "SliderReader.h"
#include "ui/UISlider.h"
#include "cocostudio/CocoLoader.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
USING_NS_CC;
using namespace ui;
@ -186,4 +188,414 @@ namespace cocostudio
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
}
void SliderReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);
Slider* slider = static_cast<Slider*>(widget);
const protocolbuffers::SliderOptions& options = nodeTree.slideroptions();
std::string protocolBuffersPath = GUIReader::getInstance()->getFilePath();
bool barTextureScale9Enable = options.scale9enable();
slider->setScale9Enabled(barTextureScale9Enable);
slider->setPercent(options.percent());
// bool bt = DICTOOL->checkObjectExist_json(options, P_BarFileName);
float barLength = options.has_length() ? options.length() : 290;
const protocolbuffers::ResourceData& imageFileNameDic = options.barfilenamedata();
int imageFileNameType = imageFileNameDic.resourcetype();
if (imageFileNameType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + imageFileNameDic.plistfile());
}
std::string imageFileName = this->getResourcePath(imageFileNameDic.path(), (Widget::TextureResType)imageFileNameType);
slider->loadBarTexture(imageFileName, (Widget::TextureResType)imageFileNameType);
if (barTextureScale9Enable)
{
slider->setContentSize(Size(barLength, slider->getContentSize().height));
}
//loading normal slider ball texture
const protocolbuffers::ResourceData& normalDic = options.ballnormaldata();
int normalType = normalDic.resourcetype();
if (normalType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + normalDic.plistfile());
}
imageFileName = this->getResourcePath(normalDic.path(), (Widget::TextureResType)normalType);
slider->loadSlidBallTextureNormal(imageFileName, (Widget::TextureResType)normalType);
//loading slider ball press texture
const protocolbuffers::ResourceData& pressedDic = options.ballpresseddata();
int pressedType = pressedDic.resourcetype();
if (pressedType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + pressedDic.plistfile());
}
std::string pressedFileName = this->getResourcePath(pressedDic.path(), (Widget::TextureResType)pressedType);
slider->loadSlidBallTexturePressed(pressedFileName, (Widget::TextureResType)pressedType);
//loading silder ball disable texture
const protocolbuffers::ResourceData& disabledDic = options.balldisableddata();
int disabledType = disabledDic.resourcetype();
if (disabledType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + disabledDic.plistfile());
}
std::string disabledFileName = this->getResourcePath(disabledDic.path(), (Widget::TextureResType)disabledType);
slider->loadSlidBallTextureDisabled(disabledFileName, (Widget::TextureResType)disabledType);
//load slider progress texture
const protocolbuffers::ResourceData& progressBarDic = options.progressbardata();
int progressBarType = progressBarDic.resourcetype();
if (progressBarType == 1)
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(protocolBuffersPath + progressBarDic.plistfile());
}
std::string progressBarFileName = this->getResourcePath(progressBarDic.path(), (Widget::TextureResType)progressBarType);
slider->loadProgressBarTexture(progressBarFileName, (Widget::TextureResType)progressBarType);
bool displaystate = true;
if(options.has_displaystate())
{
displaystate = options.displaystate();
}
slider->setBright(displaystate);
// other commonly protperties
WidgetReader::setColorPropsFromProtocolBuffers(widget, nodeTree);
}
void SliderReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
WidgetReader::setPropsFromXML(widget, objectData);
Slider* slider = static_cast<Slider*>(widget);
std::string xmlPath = GUIReader::getInstance()->getFilePath();
bool scale9Enabled = false;
float cx = 0.0f, cy = 0.0f, cw = 0.0f, ch = 0.0f;
float swf = 0.0f, shf = 0.0f;
int percent = 0;
int opacity = 255;
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Scale9Enable")
{
if (value == "True")
{
scale9Enabled = true;
}
}
else if (name == "Scale9OriginX")
{
cx = atof(value.c_str());
}
else if (name == "Scale9OriginY")
{
cy = atof(value.c_str());
}
else if (name == "Scale9Width")
{
cw = atof(value.c_str());
}
else if (name == "Scale9Height")
{
ch = atof(value.c_str());
}
else if (name == "Length")
{
}
else if (name == "PercentInfo")
{
percent = atoi(value.c_str());
}
else if (name == "DisplayState")
{
slider->setBright((value == "True") ? true : false);
if (value == "False")
{
slider->setTouchEnabled(false);
}
}
else if (name == "Alpha")
{
opacity = atoi(value.c_str());
}
attribute = attribute->Next();
}
// child elements
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "BackGroundData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
slider->loadBarTexture(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
slider->loadBarTexture(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
else if (name == "BallNormalData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
slider->loadSlidBallTextureNormal(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
slider->loadSlidBallTextureNormal(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
else if (name == "BallPressedData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
slider->loadSlidBallTexturePressed(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
slider->loadSlidBallTexturePressed(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
else if (name == "BallDisabledData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
slider->loadSlidBallTextureDisabled(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
slider->loadSlidBallTextureDisabled(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
else if (name == "ProgressBarData")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
slider->loadProgressBarTexture(xmlPath + path, Widget::TextureResType::LOCAL);
break;
}
case 1:
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(xmlPath + plistFile);
slider->loadProgressBarTexture(path, Widget::TextureResType::PLIST);
break;
}
default:
break;
}
}
child = child->NextSiblingElement();
}
slider->setScale9Enabled(scale9Enabled);
if (scale9Enabled)
{
slider->setCapInsets(Rect(cx, cy, cw, ch));
slider->setContentSize(Size(swf, shf));
}
slider->setPercent(percent);
slider->setOpacity(opacity);
}
}

View File

@ -43,6 +43,8 @@ namespace cocostudio
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ;
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
};
}

View File

@ -3,6 +3,8 @@
#include "TextAtlasReader.h"
#include "ui/UITextAtlas.h"
#include "cocostudio/CocoLoader.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
USING_NS_CC;
using namespace ui;
@ -131,4 +133,137 @@ namespace cocostudio
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
}
void TextAtlasReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);
std::string jsonPath = GUIReader::getInstance()->getFilePath();
TextAtlas* labelAtlas = static_cast<TextAtlas*>(widget);
const protocolbuffers::TextAtlasOptions& options = nodeTree.textatlasoptions();
// bool sv = DICTOOL->checkObjectExist_json(options, P_StringValue);
// bool cmf = DICTOOL->checkObjectExist_json(options, P_CharMapFile);
// bool iw = DICTOOL->checkObjectExist_json(options, P_ItemWidth);
// bool ih = DICTOOL->checkObjectExist_json(options, P_ItemHeight);
// bool scm = DICTOOL->checkObjectExist_json(options, P_StartCharMap);
const protocolbuffers::ResourceData& cmftDic = options.charmapfiledata();
int cmfType = cmftDic.resourcetype();
switch (cmfType)
{
case 0:
{
std::string tp_c = jsonPath;
const char* cmfPath = cmftDic.path().c_str();
const char* cmf_tp = tp_c.append(cmfPath).c_str();
std::string stringValue = options.has_stringvalue() ? options.stringvalue() : "12345678";
int itemWidth = options.has_itemwidth() ? options.itemwidth() : 24;
int itemHeight = options.has_itemheight() ? options.itemheight() : 32;
labelAtlas->setProperty(stringValue,
cmf_tp,
itemWidth,
itemHeight,
options.startcharmap().c_str());
break;
}
case 1:
CCLOG("Wrong res type of LabelAtlas!");
break;
default:
break;
}
// other commonly protperties
WidgetReader::setColorPropsFromProtocolBuffers(widget, nodeTree);
}
void TextAtlasReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
WidgetReader::setPropsFromXML(widget, objectData);
TextAtlas* labelAtlas = static_cast<TextAtlas*>(widget);
std::string xmlPath = GUIReader::getInstance()->getFilePath();
std::string stringValue = "", startChar = "";
int itemWidth = 0, itemHeight = 0;
int resourceType = 0;
std::string path = "", plistFile = "";
int opacity = 255;
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "LabelText")
{
stringValue = value;
}
else if (name == "CharWidth")
{
itemWidth = atoi(value.c_str());
}
else if (name == "CharHeight")
{
itemHeight = atoi(value.c_str());
}
else if (name == "StartChar")
{
startChar = value;
}
else if (name == "Alpha")
{
opacity = atoi(value.c_str());
}
attribute = attribute->Next();
}
// child elements
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "LabelAtlasFileImage_CNB")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
}
child = child->NextSiblingElement();
}
labelAtlas->setProperty(stringValue, xmlPath + path, itemWidth, itemHeight, startChar);
labelAtlas->setOpacity(opacity);
}
}

View File

@ -42,6 +42,8 @@ namespace cocostudio
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ;
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
};
}

View File

@ -3,6 +3,8 @@
#include "TextBMFontReader.h"
#include "ui/UITextBMFont.h"
#include "cocostudio/CocoLoader.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
USING_NS_CC;
using namespace ui;
@ -104,4 +106,128 @@ namespace cocostudio
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
}
void TextBMFontReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);
std::string jsonPath = GUIReader::getInstance()->getFilePath();
TextBMFont* labelBMFont = static_cast<TextBMFont*>(widget);
const protocolbuffers::TextBMFontOptions& options = nodeTree.textbmfontoptions();
const protocolbuffers::ResourceData& cmftDic = options.filenamedata();
int cmfType = cmftDic.resourcetype();
switch (cmfType)
{
case 0:
{
std::string tp_c = jsonPath;
const char* cmfPath = cmftDic.path().c_str();
const char* cmf_tp = tp_c.append(cmfPath).c_str();
labelBMFont->setFntFile(cmf_tp);
break;
}
case 1:
CCLOG("Wrong res type of LabelAtlas!");
break;
default:
break;
}
const char* text = (options.has_text()) ? options.text().c_str() : "Text Label";
labelBMFont->setString(text);
// other commonly protperties
WidgetReader::setColorPropsFromProtocolBuffers(widget, nodeTree);
}
void TextBMFontReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
WidgetReader::setPropsFromXML(widget, objectData);
TextBMFont* labelBMFont = static_cast<TextBMFont*>(widget);
std::string xmlPath = GUIReader::getInstance()->getFilePath();
std::string text = "";
int opacity = 255;
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "LabelText")
{
text = value;
}
else if (name == "Alpha")
{
opacity = atoi(value.c_str());
}
attribute = attribute->Next();
}
// child elements
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "LabelBMFontFile_CNB")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
labelBMFont->setFntFile(xmlPath + path);
break;
}
default:
break;
}
}
child = child->NextSiblingElement();
}
labelBMFont->setString(text);
labelBMFont->setOpacity(opacity);
}
}

View File

@ -43,6 +43,8 @@ namespace cocostudio
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ;
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
};
}

View File

@ -3,6 +3,8 @@
#include "TextFieldReader.h"
#include "ui/UITextField.h"
#include "cocostudio/CocoLoader.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
USING_NS_CC;
using namespace ui;
@ -134,4 +136,239 @@ namespace cocostudio
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
}
void TextFieldReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
TextField* textField = static_cast<TextField*>(widget);
const protocolbuffers::TextFieldOptions& options = nodeTree.textfieldoptions();
std::string protocolBuffersPath = GUIReader::getInstance()->getFilePath();
bool IsCustomSize = options.iscustomsize();
widget->ignoreContentAdaptWithSize(!IsCustomSize);
if (IsCustomSize)
{
const protocolbuffers::WidgetOptions& widgetOptions = nodeTree.widgetoptions();
textField->setContentSize(Size(widgetOptions.width(), widgetOptions.height()));
}
WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);
WidgetReader::setAnchorPointForWidget(widget, nodeTree);
textField->setUnifySizeEnabled(false);
bool ph = options.has_placeholder();
if (ph)
{
std::string placeholder = options.has_placeholder() ? options.placeholder() : "inputs words here";
textField->setPlaceHolder(placeholder);
}
std::string text = options.has_text() ? options.text() : "Text Field";
textField->setText(text);
int fontSize = options.has_fontsize() ? options.fontsize() : 20;
textField->setFontSize(fontSize);
std::string fontName = options.has_fontname() ? options.fontname() : "微软雅黑";
textField->setFontName(fontName);
// bool tsw = options.has_touchsizewidth();
// bool tsh = options.has_touchsizeheight();
// if (tsw && tsh)
// {
// textField->setTouchSize(Size(options.touchsizewidth(), options.touchsizeheight()));
// }
// float dw = DICTOOL->getFloatValue_json(options, "width");
// float dh = DICTOOL->getFloatValue_json(options, "height");
// if (dw > 0.0f || dh > 0.0f)
// {
// //textField->setSize(Size(dw, dh));
// }
bool maxLengthEnable = options.maxlengthenable();
textField->setMaxLengthEnabled(maxLengthEnable);
if (maxLengthEnable)
{
int maxLength = options.has_maxlength() ? options.maxlength() : 10;
textField->setMaxLength(maxLength);
}
bool passwordEnable = options.passwordenable();
textField->setPasswordEnabled(passwordEnable);
if (passwordEnable)
{
std::string passwordStyleText = options.has_passwordstyletext() ? options.passwordstyletext() : "*";
textField->setPasswordStyleText(passwordStyleText.c_str());
}
if (options.has_fontresource())
{
const protocolbuffers::ResourceData& resourceData = options.fontresource();
textField->setFontName(protocolBuffersPath + resourceData.path());
}
// other commonly protperties
WidgetReader::setColorPropsFromProtocolBuffers(widget, nodeTree);
}
void TextFieldReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
WidgetReader::setPropsFromXML(widget, objectData);
TextField* textField = static_cast<TextField*>(widget);
std::string xmlPath = GUIReader::getInstance()->getFilePath();
bool isCustomSize = false;
float width = 0.0f, height = 0.0f;
int opacity = 255;
textField->setUnifySizeEnabled(false);
textField->setFontName("微软雅黑");
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "PlaceHolderText")
{
textField->setPlaceHolder(value);
}
else if (name == "LabelText")
{
textField->setText(value);
}
else if (name == "FontSize")
{
textField->setFontSize(atoi(value.c_str()));
}
else if (name == "FontName")
{
textField->setFontName(value);
}
else if (name == "MaxLengthEnable")
{
textField->setMaxLengthEnabled((value == "True") ? true : false);
}
else if (name == "MaxLengthText")
{
textField->setMaxLength(atoi(value.c_str()));
}
else if (name == "PasswordEnable")
{
textField->setPasswordEnabled((value == "True") ? true : false);
}
else if (name == "PasswordStyleText")
{
textField->setPasswordStyleText(value.c_str());
}
else if (name == "IsCustomSize")
{
isCustomSize = ((value == "True") ? true : false);
// if (value == "Custom")
// {
// float areaWidth = 0.0f;
// objectData->QueryFloatAttribute("Width", &areaWidth);
//
// float areaHeight = 0.0f;
// objectData->QueryFloatAttribute("Height", &areaHeight);
//
// textField->setTextAreaSize(Size(areaWidth, areaHeight));
// }
}
else if (name == "Alpha")
{
opacity = atoi(value.c_str());
}
attribute = attribute->Next();
}
// child elements
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "Size")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
width = atof(value.c_str());
}
else if (name == "Y")
{
height = atof(value.c_str());
}
attribute = attribute->Next();
}
}
else if (name == "FontResource")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
textField->setFontName(xmlPath + path);
break;
}
default:
break;
}
}
child = child->NextSiblingElement();
}
if (isCustomSize)
{
textField->ignoreContentAdaptWithSize(!isCustomSize);
textField->setContentSize(Size(width, height));
}
textField->setOpacity(opacity);
}
}

View File

@ -43,6 +43,8 @@ namespace cocostudio
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ;
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
};
}

View File

@ -3,6 +3,8 @@
#include "TextReader.h"
#include "ui/UIText.h"
#include "cocostudio/CocoLoader.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
USING_NS_CC;
using namespace ui;
@ -137,4 +139,239 @@ namespace cocostudio
WidgetReader::setColorPropsFromJsonDictionary(widget, options);
}
void TextReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
Text* label = static_cast<Text*>(widget);
const protocolbuffers::TextOptions& options = nodeTree.textoptions();
bool IsCustomSize = options.iscustomsize();
label->ignoreContentAdaptWithSize(!IsCustomSize);
WidgetReader::setPropsFromProtocolBuffers(widget, nodeTree);
label->setUnifySizeEnabled(false);
std::string protocolBuffersPath = GUIReader::getInstance()->getFilePath();
bool touchScaleChangeAble = options.touchscaleenable();
label->setTouchScaleChangeEnabled(touchScaleChangeAble);
const char* text = options.has_text() ? options.text().c_str() : "Text Label";
label->setString(text);
int fontSize = options.has_fontsize() ? options.fontsize() : 20;
label->setFontSize(fontSize);
std::string fontName = options.has_fontname() ? options.fontname() : "微软雅黑";
std::string fontFilePath = protocolBuffersPath.append(fontName);
if (FileUtils::getInstance()->isFileExist(fontFilePath))
{
label->setFontName(fontFilePath);
}
else{
label->setFontName(fontName);
}
bool aw = options.has_areawidth();
bool ah = options.has_areaheight();
if (aw && ah)
{
Size size = Size(options.areawidth(), options.areaheight());
label->setTextAreaSize(size);
}
bool ha = options.has_halignment();
if (ha)
{
label->setTextHorizontalAlignment((TextHAlignment)options.halignment());
}
bool va = options.has_valignment();
if (va)
{
label->setTextVerticalAlignment((TextVAlignment)options.valignment());
}
if (options.has_fontresource())
{
const protocolbuffers::ResourceData& resourceData = options.fontresource();
label->setFontName(protocolBuffersPath + resourceData.path());
}
// other commonly protperties
WidgetReader::setColorPropsFromProtocolBuffers(widget, nodeTree);
}
void TextReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
WidgetReader::setPropsFromXML(widget, objectData);
Text* label = static_cast<Text*>(widget);
std::string xmlPath = GUIReader::getInstance()->getFilePath();
float areaWidth = 0.0f, areaHeight = 0.0f;
int halignment = 0, valignment = 0;
int opacity = 255;
label->setUnifySizeEnabled(false);
label->setFontName("微软雅黑");
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "TouchScaleChangeAble")
{
label->setTouchScaleChangeEnabled((value == "True") ? true : false);
}
else if (name == "LabelText")
{
label->setString(value);
}
else if (name == "FontSize")
{
label->setFontSize(atoi(value.c_str()));
}
else if (name == "FontName")
{
label->setFontName(value);
}
else if (name == "AreaWidth")
{
areaWidth = atoi(value.c_str());
}
else if (name == "AreaHeight")
{
areaHeight = atoi(value.c_str());
}
else if (name == "HorizontalAlignmentType")
{
if (value == "HT_Left")
{
halignment = 0;
}
else if (value == "HT_Center")
{
halignment = 1;
}
else if (value == "HT_Right")
{
halignment = 2;
}
}
else if (name == "VerticalAlignmentType")
{
if (value == "VT_Top")
{
valignment = 0;
}
else if (value == "VT_Center")
{
valignment = 1;
}
else if (value == "VT_Bottom")
{
valignment = 2;
}
}
else if (name == "Alpha")
{
opacity = atoi(value.c_str());
}
attribute = attribute->Next();
}
// child elements
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "Size")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
float width = 0.0f, height = 0.0f;
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
width = atof(value.c_str());
}
else if (name == "Y")
{
height = atof(value.c_str());
}
attribute = attribute->Next();
}
label->ignoreContentAdaptWithSize(false);
label->setContentSize(Size(width, height));
}
else if (name == "FontResource")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int resourceType = 0;
std::string path = "", plistFile = "";
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Path")
{
path = value;
}
else if (name == "Type")
{
resourceType = (value == "Normal" || value == "Default" || value == "MarkedSubImage") ? 0 : 1;
}
else if (name == "Plist")
{
plistFile = value;
}
attribute = attribute->Next();
}
switch (resourceType)
{
case 0:
{
label->setFontName(xmlPath + path);
break;
}
default:
break;
}
}
child = child->NextSiblingElement();
}
if (areaWidth != 0 || areaHeight != 0)
{
label->setTextAreaSize(Size(areaWidth, areaHeight));
}
label->setTextHorizontalAlignment((TextHAlignment)halignment);
label->setTextVerticalAlignment((TextVAlignment)valignment);
label->setOpacity(opacity);
}
}

View File

@ -43,6 +43,8 @@ namespace cocostudio
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode);
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
};
}

View File

@ -3,6 +3,9 @@
#include "WidgetReader.h"
#include "cocostudio/CocoLoader.h"
#include "ui/UIButton.h"
#include "cocostudio/CSParseBinary.pb.h"
#include "tinyxml2/tinyxml2.h"
#include "../ActionTimeline/CCActionTimeline.h"
USING_NS_CC;
using namespace ui;
@ -354,6 +357,411 @@ namespace cocostudio
this->endSetBasicProperties(widget);
}
void WidgetReader::setPropsFromProtocolBuffers(ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
const protocolbuffers::WidgetOptions& options = nodeTree.widgetoptions();
widget->setCascadeColorEnabled(true);
widget->setCascadeOpacityEnabled(true);
widget->setUnifySizeEnabled(true);
bool ignoreSizeExsit = options.has_ignoresize();
if (ignoreSizeExsit)
{
widget->ignoreContentAdaptWithSize(options.ignoresize());
}
widget->setSizeType((Widget::SizeType)options.sizetype());
widget->setPositionType((Widget::PositionType)options.positiontype());
widget->setSizePercent(Vec2(options.sizepercentx(), options.sizepercenty()));
widget->setPositionPercent(Vec2(options.positionpercentx(), options.positionpercenty()));
float w = options.width();
float h = options.height();
widget->setContentSize(Size(w, h));
widget->setTag(options.tag());
widget->setActionTag(options.actiontag());
widget->setTouchEnabled(options.touchable());
const char* name = options.name().c_str();
const char* widgetName = name ? name : "default";
widget->setName(widgetName);
float x = options.x();
float y = options.y();
widget->setPosition(Vec2(x, y));
if(options.has_alpha())
{
widget->setOpacity(options.alpha());
}
widget->setScaleX(options.has_scalex() ? options.scalex() : 1.0);
widget->setScaleY(options.has_scaley() ? options.scaley() : 1.0);
// widget->setRotation(options.has_rotation() ? options.rotation() : 0.0);
widget->setRotationSkewX(options.has_rotationskewx() ? options.rotationskewx() : 0.0);
widget->setRotationSkewY(options.has_rotationskewy() ? options.rotationskewy() : 0.0);
bool vb = options.has_visible();
if (vb)
{
widget->setVisible(options.visible());
}
int z = options.zorder();
widget->setLocalZOrder(z);
bool layout = options.has_layoutparameter();
if (layout)
{
const protocolbuffers::LayoutParameter& layoutParameterDic = options.layoutparameter();;
int paramType = layoutParameterDic.type();
LayoutParameter* parameter = nullptr;
switch (paramType)
{
case 0:
break;
case 1:
{
parameter = LinearLayoutParameter::create();
int gravity = layoutParameterDic.gravity();
((LinearLayoutParameter*)parameter)->setGravity((cocos2d::ui::LinearLayoutParameter::LinearGravity)gravity);
break;
}
case 2:
{
parameter = RelativeLayoutParameter::create();
RelativeLayoutParameter* rParameter = (RelativeLayoutParameter*)parameter;
const char* relativeName = layoutParameterDic.relativename().c_str();
rParameter->setRelativeName(relativeName);
const char* relativeToName = layoutParameterDic.relativetoname().c_str();
rParameter->setRelativeToWidgetName(relativeToName);
int align = layoutParameterDic.align();
rParameter->setAlign((cocos2d::ui::RelativeLayoutParameter::RelativeAlign)align);
break;
}
default:
break;
}
if (parameter)
{
float mgl = layoutParameterDic.marginleft();
float mgt = layoutParameterDic.margintop();
float mgr = layoutParameterDic.marginright();
float mgb = layoutParameterDic.margindown();
parameter->setMargin(Margin(mgl, mgt, mgr, mgb));
widget->setLayoutParameter(parameter);
}
}
}
void WidgetReader::setColorPropsFromProtocolBuffers(cocos2d::ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
const protocolbuffers::WidgetOptions& options = nodeTree.widgetoptions();
bool isColorRExists = options.has_colorr();
bool isColorGExists = options.has_colorg();
bool isColorBExists = options.has_colorb();
int colorR = options.colorr();
int colorG = options.colorg();
int colorB = options.colorb();
if (isColorRExists && isColorGExists && isColorBExists)
{
widget->setColor(Color3B(colorR, colorG, colorB));
}
setAnchorPointForWidget(widget, nodeTree);
bool flipX = options.flipx();
bool flipY = options.flipy();
widget->setFlippedX(flipX);
widget->setFlippedY(flipY);
}
void WidgetReader::setPropsFromXML(cocos2d::ui::Widget *widget, const tinyxml2::XMLElement *objectData)
{
widget->setTouchEnabled(false);
widget->setCascadeColorEnabled(true);
widget->setCascadeOpacityEnabled(true);
widget->setUnifySizeEnabled(true);
widget->setScale(0.0f, 0.0f);
// attributes
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "Name")
{
const char* widgetName = value.c_str() ? value.c_str() :"default";
widget->setName(widgetName);
}
else if (name == "ActionTag")
{
int actionTag = atoi(value.c_str());
widget->setUserObject(timeline::ActionTimelineData::create(actionTag));
}
else if (name == "RotationSkewX")
{
widget->setRotationSkewX(atof(value.c_str()));
}
else if (name == "RotationSkewY")
{
widget->setRotationSkewY(atof(value.c_str()));
}
else if (name == "Rotation")
{
// widget->setRotation(atoi(value.c_str()));
}
else if (name == "ZOrder")
{
widget->setLocalZOrder(atoi(value.c_str()));
}
else if (name == "Visible")
{
widget->setVisible((value == "True") ? true : false);
}
else if (name == "VisibleForFrame")
{
// widget->setVisible((value == "True") ? true : false);
}
else if (name == "Alpha")
{
widget->setOpacity(atoi(value.c_str()));
}
else if (name == "Tag")
{
widget->setTag(atoi(value.c_str()));
}
else if (name == "FlipX")
{
widget->setFlippedX((value == "True") ? true : false);
}
else if (name == "FlipY")
{
widget->setFlippedY((value == "True") ? true : false);
}
else if (name == "TouchEnable")
{
widget->setTouchEnabled((value == "True") ? true : false);
}
else if (name == "ControlSizeType")
{
widget->ignoreContentAdaptWithSize((value == "Auto") ? true : false);
}
attribute = attribute->Next();
}
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{
std::string name = child->Name();
if (name == "Children")
{
break;
}
else if (name == "Position")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
widget->setPositionX(atof(value.c_str()));
}
else if (name == "Y")
{
widget->setPositionY(atof(value.c_str()));
}
attribute = attribute->Next();
}
}
else if (name == "Scale")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "ScaleX")
{
widget->setScaleX(atof(value.c_str()));
}
else if (name == "ScaleY")
{
widget->setScaleY(atof(value.c_str()));
}
attribute = attribute->Next();
}
}
else if (name == "AnchorPoint")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
float anchor_x = 0.0f, anchor_y = 0.0f;
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "ScaleX")
{
anchor_x = atof(value.c_str());
}
else if (name == "ScaleY")
{
anchor_y = atof(value.c_str());
}
attribute = attribute->Next();
}
widget->setAnchorPoint(Vec2(anchor_x, anchor_y));
}
else if (name == "CColor")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
int red = 255, green = 255, blue = 255;
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "A")
{
widget->setOpacity(atoi(value.c_str()));
}
else if (name == "R")
{
red = atoi(value.c_str());
}
else if (name == "G")
{
green = atoi(value.c_str());
}
else if (name == "B")
{
blue = atoi(value.c_str());
}
attribute = attribute->Next();
}
widget->setColor(Color3B(red, green, blue));
}
else if (name == "Size")
{
const tinyxml2::XMLAttribute* attribute = child->FirstAttribute();
float width = 0.0f, height = 0.0f;
while (attribute)
{
std::string name = attribute->Name();
std::string value = attribute->Value();
if (name == "X")
{
width = atof(value.c_str());
}
else if (name == "Y")
{
height = atof(value.c_str());
}
attribute = attribute->Next();
}
widget->setContentSize(Size(width, height));
}
child = child->NextSiblingElement();
}
}
void WidgetReader::setAnchorPointForWidget(cocos2d::ui::Widget *widget, const protocolbuffers::NodeTree &nodeTree)
{
const protocolbuffers::WidgetOptions& options = nodeTree.widgetoptions();
bool isAnchorPointXExists = options.has_anchorpointx();
float anchorPointXInFile;
if (isAnchorPointXExists)
{
anchorPointXInFile = options.anchorpointx();
}
else
{
anchorPointXInFile = widget->getAnchorPoint().x;
}
bool isAnchorPointYExists = options.has_anchorpointy();
float anchorPointYInFile;
if (isAnchorPointYExists)
{
anchorPointYInFile = options.anchorpointy();
}
else
{
anchorPointYInFile = widget->getAnchorPoint().y;
}
if (isAnchorPointXExists || isAnchorPointYExists)
{
widget->setAnchorPoint(Vec2(anchorPointXInFile, anchorPointYInFile));
}
}
std::string WidgetReader::getResourcePath(const std::string &path, cocos2d::ui::Widget::TextureResType texType)
{
std::string filePath = GUIReader::getInstance()->getFilePath();
const char* imageFileName = path.c_str();
std::string imageFileName_tp;
if (nullptr != imageFileName && 0 != strcmp("", imageFileName))
{
if (texType == ui::Widget::TextureResType::LOCAL) {
imageFileName_tp = filePath + imageFileName;
}
else if(texType == ui::Widget::TextureResType::PLIST){
imageFileName_tp = imageFileName;
}
else{
CCASSERT(0, "invalid TextureResType!!!");
}
}
return imageFileName_tp;
}
}

View File

@ -54,6 +54,12 @@ namespace cocostudio
const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode);
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
virtual void setColorPropsFromProtocolBuffers(cocos2d::ui::Widget* widget,
const protocolbuffers::NodeTree& nodeTree);
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData);
protected:
std::string getResourcePath(const rapidjson::Value& dict,
const std::string& key,
@ -64,6 +70,11 @@ namespace cocostudio
std::string getResourcePath(CocoLoader* cocoLoader,
stExpCocoNode* pCocoNode,
cocos2d::ui::Widget::TextureResType texType);
void setAnchorPointForWidget(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree);
std::string getResourcePath(const std::string& path,
cocos2d::ui::Widget::TextureResType texType);
void beginSetBasicProperties(cocos2d::ui::Widget *widget);
void endSetBasicProperties(cocos2d::ui::Widget *widget);

View File

@ -29,6 +29,16 @@
#include "cocostudio/DictionaryHelper.h"
#include "cocostudio/CocosStudioExport.h"
namespace protocolbuffers
{
class NodeTree;
}
namespace tinyxml2
{
class XMLElement;
}
namespace cocos2d
{
namespace ui
@ -48,6 +58,8 @@ namespace cocostudio
virtual ~WidgetReaderProtocol() {};
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options) = 0;
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) = 0;
virtual void setPropsFromProtocolBuffers(cocos2d::ui::Widget* widget, const protocolbuffers::NodeTree& nodeTree) = 0;
virtual void setPropsFromXML(cocos2d::ui::Widget* widget, const tinyxml2::XMLElement* objectData) = 0;
};
}

View File

@ -74,14 +74,17 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\protobuf-lite\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WP8;_DEBUG;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
<CompileAsWinRT>true</CompileAsWinRT>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@ -97,7 +100,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;$(EngineRoot)external\protobuf-lite\win32;$(EngineRoot)external\protobuf-lite\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WP8;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
@ -116,7 +119,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;$(EngineRoot)external\protocolBuf\win32;$(EngineRoot)external\protocolBuf\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WP8;_DEBUG;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
@ -136,7 +139,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)external;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;$(EngineRoot)external\protocolBuf\win32;$(EngineRoot)external\protocolBuf\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WP8;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;CC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
@ -166,8 +169,8 @@
<ClCompile Include="..\ActionTimeline\CCActionTimeline.cpp" />
<ClCompile Include="..\ActionTimeline\CCActionTimelineCache.cpp" />
<ClCompile Include="..\ActionTimeline\CCFrame.cpp" />
<ClCompile Include="..\ActionTimeline\CCNodeReader.cpp" />
<ClCompile Include="..\ActionTimeline\CCTimeLine.cpp" />
<ClCompile Include="..\ActionTimeline\CSLoader.cpp" />
<ClCompile Include="..\CCActionFrame.cpp" />
<ClCompile Include="..\CCActionFrameEasing.cpp" />
<ClCompile Include="..\CCActionManagerEx.cpp" />
@ -199,6 +202,7 @@
<ClCompile Include="..\CCTween.cpp" />
<ClCompile Include="..\CCUtilMath.cpp" />
<ClCompile Include="..\CocoLoader.cpp" />
<ClCompile Include="..\CSParseBinary.pb.cc" />
<ClCompile Include="..\DictionaryHelper.cpp" />
<ClCompile Include="..\TriggerBase.cpp" />
<ClCompile Include="..\TriggerMng.cpp" />
@ -238,9 +242,9 @@
<ClInclude Include="..\ActionTimeline\CCActionTimeline.h" />
<ClInclude Include="..\ActionTimeline\CCActionTimelineCache.h" />
<ClInclude Include="..\ActionTimeline\CCFrame.h" />
<ClInclude Include="..\ActionTimeline\CCNodeReader.h" />
<ClInclude Include="..\ActionTimeline\CCTimeLine.h" />
<ClInclude Include="..\ActionTimeline\CCTimelineMacro.h" />
<ClInclude Include="..\ActionTimeline\CSLoader.h" />
<ClInclude Include="..\CCActionFrame.h" />
<ClInclude Include="..\CCActionFrameEasing.h" />
<ClInclude Include="..\CCActionManagerEx.h" />
@ -273,6 +277,7 @@
<ClInclude Include="..\CCTween.h" />
<ClInclude Include="..\CCUtilMath.h" />
<ClInclude Include="..\CocoLoader.h" />
<ClInclude Include="..\CSParseBinary.pb.h" />
<ClInclude Include="..\DictionaryHelper.h" />
<ClInclude Include="..\TriggerBase.h" />
<ClInclude Include="..\TriggerMng.h" />

View File

@ -241,15 +241,18 @@
<ClCompile Include="..\ActionTimeline\CCFrame.cpp">
<Filter>TimelineAction</Filter>
</ClCompile>
<ClCompile Include="..\ActionTimeline\CCNodeReader.cpp">
<Filter>TimelineAction</Filter>
</ClCompile>
<ClCompile Include="..\ActionTimeline\CCTimeLine.cpp">
<Filter>TimelineAction</Filter>
</ClCompile>
<ClCompile Include="..\CocoLoader.cpp">
<Filter>json</Filter>
</ClCompile>
<ClCompile Include="..\CSParseBinary.pb.cc">
<Filter>json</Filter>
</ClCompile>
<ClCompile Include="..\ActionTimeline\CSLoader.cpp">
<Filter>TimelineAction</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\CCComAttribute.h">
@ -442,9 +445,6 @@
<ClInclude Include="..\ActionTimeline\CCFrame.h">
<Filter>TimelineAction</Filter>
</ClInclude>
<ClInclude Include="..\ActionTimeline\CCNodeReader.h">
<Filter>TimelineAction</Filter>
</ClInclude>
<ClInclude Include="..\ActionTimeline\CCTimeLine.h">
<Filter>TimelineAction</Filter>
</ClInclude>
@ -454,5 +454,11 @@
<ClInclude Include="..\CocoLoader.h">
<Filter>json</Filter>
</ClInclude>
<ClInclude Include="..\CSParseBinary.pb.h">
<Filter>json</Filter>
</ClInclude>
<ClInclude Include="..\ActionTimeline\CSLoader.h">
<Filter>TimelineAction</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -407,7 +407,7 @@ static void extendBone(lua_State* L)
lua_pop(L, 1);
}
int lua_cocos2dx_studio_NodeReader_getInstance(lua_State* L)
int lua_cocos2dx_studio_CSLoader_getInstance(lua_State* L)
{
int argc = 0;
bool ok = true;
@ -417,7 +417,7 @@ int lua_cocos2dx_studio_NodeReader_getInstance(lua_State* L)
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(L,1,"ccs.NodeReader",0,&tolua_err)) goto tolua_lerror;
if (!tolua_isusertable(L,1,"cc.CSLoader",0,&tolua_err)) goto tolua_lerror;
#endif
argc = lua_gettop(L) - 1;
@ -426,26 +426,26 @@ int lua_cocos2dx_studio_NodeReader_getInstance(lua_State* L)
{
if(!ok)
return 0;
cocostudio::timeline::NodeReader* ret = cocostudio::timeline::NodeReader::getInstance();
tolua_pushusertype(L,(void*)ret, "ccs.NodeReader");
CSLoader* ret = CSLoader::getInstance();
tolua_pushusertype(L,(void*)ret, "cc.CSLoader");
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "ccs.NodeReader:getInstance",argc, 0);
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.CSLoader:getInstance",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(L,"#ferror in function 'lua_cocos2dx_studio_NodeReader_getInstance'.",&tolua_err);
tolua_error(L,"#ferror in function 'lua_cocos2dx_studio_CSLoader_getInstance'.",&tolua_err);
#endif
return 0;
}
static void extendNodeReader(lua_State* L)
static void extendCSLoader(lua_State* L)
{
lua_pushstring(L, "ccs.NodeReader");
lua_pushstring(L, "cc.CSLoader");
lua_rawget(L, LUA_REGISTRYINDEX);
if (lua_istable(L,-1))
{
tolua_function(L, "getInstance", lua_cocos2dx_studio_NodeReader_getInstance);
tolua_function(L, "getInstance", lua_cocos2dx_studio_CSLoader_getInstance);
}
lua_pop(L, 1);
}
@ -611,7 +611,7 @@ int register_all_cocos2dx_coco_studio_manual(lua_State* L)
extendArmatureDataManager(L);
extendBone(L);
extendActionTimelineCache(L);
extendNodeReader(L);
extendCSLoader(L);
extendActionTimeline(L);
return 0;

View File

@ -35,7 +35,7 @@ UIWebView.cpp \
UIWebViewImpl-android.cpp \
UIEditBox/UIEditBox.cpp \
UIEditBox/UIEditBoxImpl-android.cpp \
UILayoutComponent.cpp \
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../editor-support

View File

@ -46,6 +46,7 @@ set(COCOS_UI_SRC
ui/UIWebView.cpp
ui/UIWidget.cpp
ui/UIEditBox/UIEditBox.cpp
ui/UILayoutComponent.cpp
${COCOS_UI_SPECIFIC_SRC}
)

View File

@ -55,6 +55,7 @@ THE SOFTWARE.
#include "ui/GUIExport.h"
#include "ui/UIScale9Sprite.h"
#include "ui/UIEditBox/UIEditBox.h"
#include "ui/UILayoutComponent.h"
NS_CC_BEGIN
namespace ui {

View File

@ -69,4 +69,6 @@
#define CC_VIDEOPLAYER_DEBUG_DRAW 0
#define __LAYOUT_COMPONENT_NAME "__ui_layout"
#endif /* defined(__TestCpp__GUIDefine__) */

View File

@ -192,6 +192,20 @@ bool Button::isScale9Enabled()const
void Button::ignoreContentAdaptWithSize(bool ignore)
{
if (_unifySize)
{
if (_scale9Enabled)
{
ProtectedNode::setContentSize(_customSize);
}
else
{
Size s = getVirtualRendererSize();
ProtectedNode::setContentSize(s);
}
onSizeChanged();
return;
}
if (!_scale9Enabled || (_scale9Enabled && !ignore))
{
Widget::ignoreContentAdaptWithSize(ignore);
@ -310,12 +324,29 @@ void Button::setCapInsets(const Rect &capInsets)
void Button::setCapInsetsNormalRenderer(const Rect &capInsets)
{
_capInsetsNormal = capInsets;
float x = capInsets.origin.x;
float y = capInsets.origin.y;
float width = capInsets.size.width;
float height = capInsets.size.height;
if (_normalTextureSize.width < width)
{
x = 0.0f;
width = 0.0f;
}
if (_normalTextureSize.height < height)
{
y = 0.0f;
height = 0.0f;
}
Rect rect(x, y, width, height);
_capInsetsNormal = rect;
if (!_scale9Enabled)
{
return;
}
_buttonNormalRenderer->setCapInsets(capInsets);
_buttonNormalRenderer->setCapInsets(rect);
}
const Rect& Button::getCapInsetsNormalRenderer()const
@ -325,12 +356,29 @@ const Rect& Button::getCapInsetsNormalRenderer()const
void Button::setCapInsetsPressedRenderer(const Rect &capInsets)
{
_capInsetsPressed = capInsets;
float x = capInsets.origin.x;
float y = capInsets.origin.y;
float width = capInsets.size.width;
float height = capInsets.size.height;
if (_pressedTextureSize.width < width)
{
x = 0.0f;
width = 0.0f;
}
if (_pressedTextureSize.height < height)
{
y = 0.0f;
height = 0.0f;
}
Rect rect(x, y, width, height);
_capInsetsPressed = rect;
if (!_scale9Enabled)
{
return;
}
_buttonClickedRenderer->setCapInsets(capInsets);
_buttonClickedRenderer->setCapInsets(rect);
}
const Rect& Button::getCapInsetsPressedRenderer()const
@ -340,12 +388,29 @@ const Rect& Button::getCapInsetsPressedRenderer()const
void Button::setCapInsetsDisabledRenderer(const Rect &capInsets)
{
_capInsetsDisabled = capInsets;
float x = capInsets.origin.x;
float y = capInsets.origin.y;
float width = capInsets.size.width;
float height = capInsets.size.height;
if (_disabledTextureSize.width < width)
{
x = 0.0f;
width = 0.0f;
}
if (_disabledTextureSize.height < height)
{
y = 0.0f;
height = 0.0f;
}
Rect rect(x, y, width, height);
_capInsetsDisabled = rect;
if (!_scale9Enabled)
{
return;
}
_buttonDisableRenderer->setCapInsets(capInsets);
_buttonDisableRenderer->setCapInsets(rect);
}
const Rect& Button::getCapInsetsDisabledRenderer()const
@ -531,7 +596,11 @@ Node* Button::getVirtualRenderer()
void Button::normalTextureScaleChangedWithSize()
{
if (_ignoreSize)
if (_unifySize)
{
_buttonNormalRenderer->setPreferredSize(_contentSize);
}
else if (_ignoreSize)
{
if (!_scale9Enabled)
{
@ -569,7 +638,11 @@ void Button::normalTextureScaleChangedWithSize()
void Button::pressedTextureScaleChangedWithSize()
{
if (_ignoreSize)
if (_unifySize)
{
_buttonClickedRenderer->setPreferredSize(_contentSize);
}
else if (_ignoreSize)
{
if (!_scale9Enabled)
{
@ -606,7 +679,11 @@ void Button::pressedTextureScaleChangedWithSize()
void Button::disabledTextureScaleChangedWithSize()
{
if (_ignoreSize)
if (_unifySize)
{
_buttonDisableRenderer->setPreferredSize(_contentSize);
}
else if (_ignoreSize)
{
if (!_scale9Enabled)
{
@ -703,6 +780,10 @@ void Button::setTitleFontName(const std::string& fontName)
_type = FontType::TTF;
} else{
_titleRenderer->setSystemFontName(fontName);
if (_type == FontType::TTF)
{
_titleRenderer->requestSystemFontRefresh();
}
_type = FontType::SYSTEM;
}
_fontName = fontName;

View File

@ -317,6 +317,10 @@ void CheckBox::onPressStateChangedToNormal()
_backGroundSelectedBoxRenderer->setVisible(false);
_backGroundBoxDisabledRenderer->setVisible(false);
_frontCrossDisabledRenderer->setVisible(false);
if (_isSelected)
{
_frontCrossRenderer->setVisible(true);
}
}
void CheckBox::onPressStateChangedToPressed()

View File

@ -24,6 +24,7 @@ THE SOFTWARE.
#include "ui/UIHelper.h"
#include "ui/UIWidget.h"
#include "ui/UILayoutComponent.h"
NS_CC_BEGIN
@ -146,6 +147,37 @@ std::string Helper::getSubStringOfUTF8String(const std::string& str, std::string
return str.substr(min,max);
}
void Helper::doLayout(cocos2d::Node *rootNode)
{
for(auto& node : rootNode->getChildren())
{
auto com = node->getComponent(__LAYOUT_COMPONENT_NAME);
Node *parent = node->getParent();
if (nullptr != com && nullptr != parent) {
LayoutComponent* layoutComponent = (LayoutComponent*)com;
if (layoutComponent->isUsingPercentPosition())
{
layoutComponent->RefreshLayoutPosition(LayoutComponent::PositionType::PreRelativePosition,layoutComponent->getPercentPosition());
}
else if (layoutComponent->getReferencePoint() != LayoutComponent::ReferencePoint::BOTTOM_LEFT)
{
layoutComponent->RefreshLayoutPosition(LayoutComponent::PositionType::RelativePosition,layoutComponent->getRelativePosition());
}
if (layoutComponent->isUsingPercentContentSize())
{
layoutComponent->RefreshLayoutSize(LayoutComponent::SizeType::PreSize,layoutComponent->getPercentContentSize());
}
Widget* uiWidget = dynamic_cast<Widget*>(node);
if ( nullptr == uiWidget )
{
doLayout(node);
}
}
}
}
}
NS_CC_END

View File

@ -28,6 +28,7 @@ THE SOFTWARE.
#include <string>
#include "platform/CCPlatformMacros.h"
#include "ui/GUIExport.h"
#include "2d/CCNode.h"
NS_CC_BEGIN
@ -77,6 +78,8 @@ public:
static std::string getSubStringOfUTF8String(const std::string& str,
std::string::size_type start,
std::string::size_type length);
static void doLayout(Node *rootNode);
};
}

View File

@ -644,6 +644,7 @@ void Layout::setBackGroundImage(const std::string& fileName,TextureResType texTy
if (_backGroundImage == nullptr)
{
addBackGroundImage();
_backGroundImage->setScale9Enabled(_backGroundScale9Enabled);
}
_backGroundImageFileName = fileName;
_bgImageTexType = texType;

View File

@ -0,0 +1,341 @@
/****************************************************************************
Copyright (c) 2013-2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "UILayoutComponent.h"
#include "2d/CCNode.h"
#include "GUIDefine.h"
NS_CC_BEGIN
namespace ui {
LayoutComponent::LayoutComponent()
:_actived(true)
,_usingPercentContentSize(false)
,_usingPercentPosition(false)
,_referencePoint(ReferencePoint::BOTTOM_LEFT)
{
_name = __LAYOUT_COMPONENT_NAME;
}
LayoutComponent::~LayoutComponent()
{
}
bool LayoutComponent::init()
{
bool ret = true;
do
{
if (!Component::init())
{
ret = false;
break;
}
//put layout component initalized code here
} while (0);
return ret;
}
//Size
const Vec2& LayoutComponent::getOwnerContentSize()const
{
return this->getOwner()->getContentSize();
}
void LayoutComponent::setOwnerContentSize(const Vec2& percent)
{
this->RefreshLayoutSize(SizeType::Size,percent);
}
const Vec2& LayoutComponent::getPercentContentSize()const
{
return _percentContentSize;
}
void LayoutComponent::setPercentContentSize(const Vec2& percent)
{
this->RefreshLayoutSize(SizeType::PreSize,percent);
}
bool LayoutComponent::isUsingPercentContentSize()
{
return _usingPercentContentSize;
}
void LayoutComponent::setUsingPercentContentSize(bool flag)
{
_usingPercentContentSize = flag;
this->RefreshLayoutSize(SizeType::PreSizeEnable,Vec2(0,0));
}
void LayoutComponent::RefreshLayoutSize(SizeType sType, const Vec2& size)
{
Node* parentNode = this->getOwner()->getParent();
if (parentNode != NULL && _actived)
{
Size parentSize = parentNode->getContentSize();
switch (sType)
{
case SizeType::Size:
if (parentSize.width != 0 && parentSize.height != 0)
{
_percentContentSize = Point(size.x/parentSize.width,size.y/parentSize.height);
}
else
{
_percentContentSize = Point(0,0);
}
this->getOwner()->setContentSize(Size(size.x,size.y));
break;
case SizeType::PreSize:
_percentContentSize = size;
if (_usingPercentContentSize)
{
this->getOwner()->setContentSize(Size(size.x*parentSize.width,size.y*parentSize.height));
}
break;
case SizeType::PreSizeEnable:
if (_usingPercentContentSize)
{
Size baseSize = this->getOwner()->getContentSize();
if (parentSize.width != 0)
{
_percentContentSize.x = baseSize.width/parentSize.width;
}
else
{
_percentContentSize.x = 0;
baseSize.width = 0;
}
if (parentSize.height != 0)
{
_percentContentSize.y = baseSize.height/parentSize.height;
}
else
{
_percentContentSize.y = 0;
baseSize.height = 0;
}
this->getOwner()->setContentSize(baseSize);
}
break;
default:
break;
}
}
else
{
switch (sType)
{
case SizeType::Size:
this->getOwner()->setContentSize(Size(size.x,size.y));
break;
case SizeType::PreSize:
_percentContentSize = size;
break;
default:
break;
}
}
}
//Position
bool LayoutComponent::isUsingPercentPosition()
{
return _usingPercentPosition;
}
void LayoutComponent::setUsingPercentPosition(bool flag)
{
_usingPercentPosition = flag;
this->RefreshLayoutPosition(PositionType::PreRelativePositionEnable,Vec2(0,0));
}
const Vec2& LayoutComponent::getPercentPosition()
{
return _percentPosition;
}
void LayoutComponent::setPercentPosition(const Vec2& percent)
{
this->RefreshLayoutPosition(PositionType::PreRelativePosition,percent);
}
const Vec2& LayoutComponent::getOwnerPosition()const
{
return this->getOwner()->getPosition();
}
void LayoutComponent::setOwnerPosition(const Vec2& point)
{
this->RefreshLayoutPosition(PositionType::Position,point);
}
const Vec2& LayoutComponent::getRelativePosition()
{
return _relativePosition;
}
void LayoutComponent::setRelativePosition(const Vec2& position)
{
this->RefreshLayoutPosition(PositionType::RelativePosition,position);
}
LayoutComponent::ReferencePoint LayoutComponent::getReferencePoint()
{
return _referencePoint;
}
void LayoutComponent::setReferencePoint(ReferencePoint point)
{
_referencePoint = point;
this->RefreshLayoutPosition(PositionType::RelativePosition,_relativePosition);
}
void LayoutComponent::RefreshLayoutPosition(PositionType pType,const Vec2& point)
{
Node* parentNode = this->getOwner()->getParent();
Point basePoint = point;
if (parentNode != NULL && _actived)
{
Size parentSize = parentNode->getContentSize();
if ( pType == PositionType::PreRelativePosition)
{
_percentPosition = point;
basePoint = Point(_percentPosition.x*parentSize.width,_percentPosition.y*parentSize.height);
}
else if(pType == PositionType::PreRelativePositionEnable)
{
if (_usingPercentPosition)
{
if (parentSize.width != 0)
{
_percentPosition.x = _relativePosition.x/parentSize.width;
}
else
{
_percentPosition.x = 0;
_relativePosition.x = 0;
}
if (parentSize.height != 0)
{
_percentPosition.y = _relativePosition.y/parentSize.height;
}
else
{
_percentPosition.y = 0;
_relativePosition.y = 0;
}
}
basePoint = _relativePosition;
}
Point inversePoint = basePoint;
switch (_referencePoint)
{
case ReferencePoint::TOP_LEFT:
inversePoint.y = parentSize.height - inversePoint.y;
break;
case ReferencePoint::BOTTOM_RIGHT:
inversePoint.x = parentSize.width - inversePoint.x;
break;
case ReferencePoint::TOP_RIGHT:
inversePoint.x = parentSize.width - inversePoint.x;
inversePoint.y = parentSize.height - inversePoint.y;
break;
default:
break;
}
switch (pType)
{
case PositionType::Position:
this->getOwner()->setPosition(basePoint);
_relativePosition = inversePoint;
if (parentSize.width != 0 && parentSize.height != 0)
{
_percentPosition = Point(_relativePosition.x/parentSize.width,_relativePosition.y/parentSize.height);
}
else
{
_percentPosition = Point(0,0);
}
break;
case PositionType::RelativePosition:
this->getOwner()->setPosition(inversePoint);
_relativePosition = basePoint;
if (parentSize.width != 0 && parentSize.height != 0)
{
_percentPosition = Point(_relativePosition.x/parentSize.width,_relativePosition.y/parentSize.height);
}
else
{
_percentPosition = Point(0,0);
}
break;
case PositionType::PreRelativePosition:
this->getOwner()->setPosition(inversePoint);
_relativePosition = basePoint;
break;
case PositionType::PreRelativePositionEnable:
this->getOwner()->setPosition(inversePoint);
_relativePosition = basePoint;
break;
default:
break;
}
}
else
{
switch (pType)
{
case PositionType::Position:
this->getOwner()->setPosition(basePoint);
if (_referencePoint == ReferencePoint::BOTTOM_LEFT)
{
_relativePosition = basePoint;
}
break;
case PositionType::RelativePosition:
_relativePosition = basePoint;
break;
case PositionType::PreRelativePosition:
_percentPosition = basePoint;
break;
default:
break;
}
}
}
void LayoutComponent::SetActiveEnable(bool enable)
{
_actived = enable;
}
}
NS_CC_END

View File

@ -0,0 +1,114 @@
/****************************************************************************
Copyright (c) 2013-2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __cocos2d_libs__LayoutComponent__
#define __cocos2d_libs__LayoutComponent__
#include "2d/CCComponent.h"
#include "ui/GUIExport.h"
NS_CC_BEGIN
namespace ui {
class CC_GUI_DLL LayoutComponent : public Component
{
public:
LayoutComponent();
~LayoutComponent();
virtual bool init()override;
CREATE_FUNC(LayoutComponent);
/**
* When a node has a ReferencePositoin with value equals LEFT_BOTTOM,
* it will treat the left bottom corner of its parent as the origin(0,0) when positioning itself
* which is the same as cocos2d-x does. But you can change it by assigning a
* different ReferencePosition.
* For example: If you use ReferencePosition with value equals RIGHT_TOP,
* then it will treat the right top corner of its parent as the origin(0,0) when positioning itself.
*/
enum class ReferencePoint
{
BOTTOM_LEFT,
TOP_LEFT,
BOTTOM_RIGHT,
TOP_RIGHT
};
enum class PositionType
{
Position,
RelativePosition,
PreRelativePosition,
PreRelativePositionEnable
};
enum class SizeType
{
Size,
PreSize,
PreSizeEnable
};
bool isUsingPercentPosition();
void setUsingPercentPosition(bool flag);
const Vec2& getPercentPosition();
void setPercentPosition(const Vec2& percent);
const Vec2& getRelativePosition();
void setRelativePosition(const Vec2& position);
void setReferencePoint(ReferencePoint point);
ReferencePoint getReferencePoint();
const Vec2& getOwnerPosition()const;
void setOwnerPosition(const Vec2& point);
void RefreshLayoutPosition(PositionType pType,const Vec2& point);
const Vec2& getOwnerContentSize()const;
void setOwnerContentSize(const Vec2& percent);
const Vec2& getPercentContentSize()const;
void setPercentContentSize(const Vec2& percent);
bool isUsingPercentContentSize();
void setUsingPercentContentSize(bool flag);
void RefreshLayoutSize(SizeType sType, const Vec2& size);
void SetActiveEnable(bool enable);
private:
Vec2 _percentContentSize;
bool _usingPercentContentSize;
ReferencePoint _referencePoint;
Vec2 _relativePosition;
Vec2 _percentPosition;
bool _usingPercentPosition;
bool _actived;
};
}
NS_CC_END
#endif /* defined(__cocos2d_libs__LayoutComponent__) */

View File

@ -100,14 +100,14 @@ void LoadingBar::setDirection(cocos2d::ui::LoadingBar::Direction direction)
{
case Direction::LEFT:
_barRenderer->setAnchorPoint(Vec2(0.0f,0.5f));
_barRenderer->setPosition(0,0.0f);
_barRenderer->setPosition(Vec2(0,_contentSize.height*0.5f));
if (!_scale9Enabled) {
_barRenderer->setFlippedX(false);
}
break;
case Direction::RIGHT:
_barRenderer->setAnchorPoint(Vec2(1.0f,0.5f));
_barRenderer->setPosition(_totalLength,0.0f);
_barRenderer->setPosition(Vec2(_totalLength,_contentSize.height*0.5f));
if (!_scale9Enabled) {
_barRenderer->setFlippedX(true);
}
@ -149,13 +149,13 @@ void LoadingBar::loadTexture(const std::string& texture,TextureResType texType)
case Direction::LEFT:
_barRenderer->setAnchorPoint(Vec2(0.0f,0.5f));
if (!_scale9Enabled) {
_barRenderer->setFlippedX(false);
_barRenderer->getSprite()->setFlippedX(false);
}
break;
case Direction::RIGHT:
_barRenderer->setAnchorPoint(Vec2(1.0f,0.5f));
if (!_scale9Enabled) {
_barRenderer->setFlippedX(true);
_barRenderer->getSprite()->setFlippedX(true);
}
break;
}
@ -216,11 +216,11 @@ void LoadingBar::setPercent(float percent)
{
return;
}
_percent = percent;
if (_totalLength <= 0)
{
return;
}
_percent = percent;
float res = _percent / 100.0f;
if (_scale9Enabled)
@ -277,7 +277,13 @@ Node* LoadingBar::getVirtualRenderer()
void LoadingBar::barRendererScaleChangedWithSize()
{
if (_ignoreSize)
if (_unifySize)
{
//_barRenderer->setPreferredSize(_contentSize);
_totalLength = _contentSize.width;
this->setPercent(_percent);
}
else if (_ignoreSize)
{
if (!_scale9Enabled)
{
@ -310,10 +316,10 @@ void LoadingBar::barRendererScaleChangedWithSize()
switch (_direction)
{
case Direction::LEFT:
_barRenderer->setPosition(0.0f, _contentSize.height / 2.0f);
_barRenderer->setPosition(Vec2(0.0f,_contentSize.height*0.5f));
break;
case Direction::RIGHT:
_barRenderer->setPosition(_totalLength, _contentSize.height / 2.0f);
_barRenderer->setPosition(Vec2(_totalLength,_contentSize.height*0.5f));
break;
default:
break;

View File

@ -123,6 +123,10 @@ void ScrollView::initRenderer()
{
Layout::initRenderer();
_innerContainer = Layout::create();
_innerContainer->setColor(Color3B(255,255,255));
_innerContainer->setOpacity(255);
_innerContainer->setCascadeColorEnabled(true);
_innerContainer->setCascadeOpacityEnabled(true);
addProtectedChild(_innerContainer, 1, 1);
}
@ -1821,8 +1825,6 @@ Widget* ScrollView::findNextFocusedWidget(cocos2d::ui::Widget::FocusDirection di
return Widget::findNextFocusedWidget(direction, current);
}
}
}
NS_CC_END

View File

@ -461,7 +461,12 @@ Node* Slider::getVirtualRenderer()
void Slider::barRendererScaleChangedWithSize()
{
if (_ignoreSize)
if (_unifySize)
{
_barLength = _contentSize.width;
_barRenderer->setPreferredSize(_contentSize);
}
else if (_ignoreSize)
{
_barRenderer->setScale(1.0f);
@ -494,7 +499,11 @@ void Slider::barRendererScaleChangedWithSize()
void Slider::progressBarRendererScaleChangedWithSize()
{
if (_ignoreSize)
if (_unifySize)
{
_progressBarRenderer->setPreferredSize(_contentSize);
}
else if (_ignoreSize)
{
if (!_scale9Enabled)
{

View File

@ -155,6 +155,10 @@ void Text::setFontName(const std::string& name)
}
else{
_labelRenderer->setSystemFontName(name);
if (_type == Type::TTF)
{
_labelRenderer->requestSystemFontRefresh();
}
_type = Type::SYSTEM;
}
_fontName = name;
@ -306,6 +310,7 @@ void Text::labelScaleChangedWithSize()
{
if (_ignoreSize)
{
_labelRenderer->setDimensions(0,0);
_labelRenderer->setScale(1.0f);
_normalScaleValueX = _normalScaleValueY = 1.0f;
}

View File

@ -496,6 +496,10 @@ void TextField::setFontName(const std::string& name)
_fontType = FontType::TTF;
} else {
_textFieldRenderer->setSystemFontName(name);
if (_fontType == FontType::TTF)
{
_textFieldRenderer->requestSystemFontRefresh();
}
_fontType = FontType::SYSTEM;
}
_fontName = name;

View File

@ -30,6 +30,7 @@ THE SOFTWARE.
#include "base/CCDirector.h"
#include "base/CCEventFocus.h"
#include "base/CCEventDispatcher.h"
#include "ui/UILayoutComponent.h"
NS_CC_BEGIN
@ -135,6 +136,7 @@ Widget* Widget::_focusedWidget = nullptr;
Widget::FocusNavigationController* Widget::_focusNavigationController = nullptr;
Widget::Widget():
_unifySize(false),
_enabled(true),
_bright(true),
_touchEnabled(false),
@ -217,8 +219,13 @@ bool Widget::init()
void Widget::onEnter()
{
updateSizeAndPosition();
ProtectedNode::onEnter();
if (_positionType == PositionType::PERCENT
|| _sizeType == SizeType::PERCENT) {
if (_parent) {
Helper::doLayout(_parent);
}
}
}
void Widget::onExit()
@ -250,40 +257,33 @@ void Widget::initRenderer()
{
}
LayoutComponent* Widget::getOrCreateLayoutComponent()
{
auto layoutComponent = this->getComponent(__LAYOUT_COMPONENT_NAME);
if (nullptr == layoutComponent)
{
LayoutComponent *component = LayoutComponent::create();
this->addComponent(component);
layoutComponent = component;
}
return (LayoutComponent*)layoutComponent;
}
void Widget::setContentSize(const cocos2d::Size &contentSize)
{
ProtectedNode::setContentSize(contentSize);
_customSize = contentSize;
if (_ignoreSize)
if (_unifySize)
{
//unify Size logic
}
else if (_ignoreSize)
{
_contentSize = getVirtualRendererSize();
}
if (_running)
{
Widget* widgetParent = getWidgetParent();
Size pSize;
if (widgetParent)
{
pSize = widgetParent->getContentSize();
}
else
{
pSize = _parent->getContentSize();
}
float spx = 0.0f;
float spy = 0.0f;
if (pSize.width > 0.0f)
{
spx = _customSize.width / pSize.width;
}
if (pSize.height > 0.0f)
{
spy = _customSize.height / pSize.height;
}
_sizePercent = Vec2(spx, spy);
}
onSizeChanged();
}
@ -294,29 +294,15 @@ void Widget::setSize(const Size &size)
void Widget::setSizePercent(const Vec2 &percent)
{
_sizePercent = percent;
Size cSize = _customSize;
if (_running)
auto component = this->getOrCreateLayoutComponent();
component->setUsingPercentContentSize(true);
component->setPercentContentSize(percent);
if (nullptr != _parent)
{
Widget* widgetParent = getWidgetParent();
if (widgetParent)
{
cSize = Size(widgetParent->getContentSize().width * percent.x , widgetParent->getContentSize().height * percent.y);
}
else
{
cSize = Size(_parent->getContentSize().width * percent.x , _parent->getContentSize().height * percent.y);
}
Helper::doLayout(_parent);
}
if (_ignoreSize)
{
this->setContentSize(getVirtualRendererSize());
}
else
{
this->setContentSize(cSize);
}
_customSize = cSize;
}
void Widget::updateSizeAndPosition()
@ -401,6 +387,17 @@ void Widget::updateSizeAndPosition(const cocos2d::Size &parentSize)
void Widget::setSizeType(SizeType type)
{
_sizeType = type;
auto component = this->getOrCreateLayoutComponent();
if (_sizeType == Widget::SizeType::PERCENT)
{
component->setUsingPercentContentSize(true);
}
else
{
component->setUsingPercentContentSize(false);
}
}
Widget::SizeType Widget::getSizeType() const
@ -410,6 +407,11 @@ Widget::SizeType Widget::getSizeType() const
void Widget::ignoreContentAdaptWithSize(bool ignore)
{
if (_unifySize)
{
this->setContentSize(_customSize);
return;
}
if (_ignoreSize == ignore)
{
return;
@ -441,9 +443,11 @@ const Size& Widget::getCustomSize() const
return _customSize;
}
const Vec2& Widget::getSizePercent() const
const Vec2& Widget::getSizePercent()
{
return _sizePercent;
auto component = this->getOrCreateLayoutComponent();
return component->getPercentContentSize();
}
Vec2 Widget::getWorldPosition()const
@ -458,14 +462,7 @@ Node* Widget::getVirtualRenderer()
void Widget::onSizeChanged()
{
for (auto& child : getChildren())
{
Widget* widgetChild = dynamic_cast<Widget*>(child);
if (widgetChild)
{
widgetChild->updateSizeAndPosition();
}
}
Helper::doLayout(this);
}
Size Widget::getVirtualRendererSize() const
@ -475,6 +472,11 @@ Size Widget::getVirtualRendererSize() const
void Widget::updateContentSizeWithTextureSize(const cocos2d::Size &size)
{
if (_unifySize)
{
this->setContentSize(size);
return;
}
if (_ignoreSize)
{
this->setContentSize(size);
@ -912,47 +914,36 @@ void Widget::interceptTouchEvent(cocos2d::ui::Widget::TouchEventType event, coco
void Widget::setPosition(const Vec2 &pos)
{
if (_running)
{
Widget* widgetParent = getWidgetParent();
if (widgetParent)
{
Size pSize = widgetParent->getContentSize();
if (pSize.width <= 0.0f || pSize.height <= 0.0f)
{
_positionPercent = Vec2::ZERO;
}
else
{
_positionPercent = Vec2(pos.x / pSize.width, pos.y / pSize.height);
}
}
}
ProtectedNode::setPosition(pos);
_positionType = PositionType::ABSOLUTE;
}
void Widget::setPositionPercent(const Vec2 &percent)
{
_positionPercent = percent;
if (_running)
{
Widget* widgetParent = getWidgetParent();
if (widgetParent)
{
Size parentSize = widgetParent->getContentSize();
Vec2 absPos = Vec2(parentSize.width * _positionPercent.x, parentSize.height * _positionPercent.y);
setPosition(absPos);
}
}
this->setNormalizedPosition(percent);
_positionType = PositionType::PERCENT;
}
const Vec2& Widget::getPositionPercent()const{
return _positionPercent;
return this->getNormalizedPosition();
}
void Widget::setPositionType(PositionType type)
{
_positionType = type;
if (type == Widget::PositionType::ABSOLUTE)
{
Vec2 oldPosition = this->getPosition();
this->setPosition(this->getPosition() + Vec2(10,0));
this->setPosition(oldPosition);
}
else
{
Vec2 oldNormalizedPosition = this->getNormalizedPosition();
this->setNormalizedPosition(oldNormalizedPosition + Vec2(0.2,0.1));
this->setNormalizedPosition(oldNormalizedPosition);
}
}
Widget::PositionType Widget::getPositionType() const
@ -1273,6 +1264,16 @@ void Widget::enableDpadNavigation(bool enable)
}
bool Widget::isUnifySizeEnabled()const
{
return _unifySize;
}
void Widget::setUnifySizeEnabled(bool enable)
{
_unifySize = enable;
}
}
NS_CC_END

View File

@ -37,7 +37,7 @@ class EventListenerTouchOneByOne;
namespace ui {
class LayoutComponent;
typedef enum
{
TOUCH_EVENT_BEGAN,
@ -416,7 +416,7 @@ public:
*
* @return size percent
*/
const Vec2& getSizePercent() const;
const Vec2& getSizePercent();
/**
* Checks a point if is in widget's space
@ -596,6 +596,12 @@ public:
* use this function to manually specify the next focused widget regards to each direction
*/
std::function<Widget*(FocusDirection)> onNextFocusedWidget;
/**
*@param enable Unify Size of a widget
*@return void
*/
void setUnifySizeEnabled(bool enable);
CC_CONSTRUCTOR_ACCESS:
@ -632,6 +638,10 @@ CC_CONSTRUCTOR_ACCESS:
*@return void
*/
void dispatchFocusEvent(Widget* widgetLoseFocus, Widget* widgetGetFocus);
/**
*@return true represent the widget use Unify Size, false represent the widget couldn't use Unify Size
*/
bool isUnifySizeEnabled()const;
protected:
//call back function called when size changed.
@ -671,8 +681,10 @@ protected:
bool isAncestorsVisible(Node* node);
void cleanupWidget();
LayoutComponent* getOrCreateLayoutComponent();
protected:
bool _unifySize;
bool _enabled;
bool _bright;
bool _touchEnabled;

View File

@ -188,6 +188,7 @@
<ClInclude Include="..\UIEditBox\UIEditBoxImpl-wp8.h" />
<ClInclude Include="..\UIEditBox\UIEditBoxImpl.h" />
<ClInclude Include="..\UIHBox.h" />
<ClInclude Include="..\UILayoutComponent.h" />
<ClInclude Include="..\UILayoutManager.h" />
<ClInclude Include="..\UIRelativeBox.h" />
<ClInclude Include="..\UIScale9Sprite.h" />
@ -216,6 +217,7 @@
<ClCompile Include="..\UIEditBox\UIEditBox.cpp" />
<ClCompile Include="..\UIEditBox\UIEditBoxImpl-wp8.cpp" />
<ClCompile Include="..\UIHBox.cpp" />
<ClCompile Include="..\UILayoutComponent.cpp" />
<ClCompile Include="..\UILayoutManager.cpp" />
<ClCompile Include="..\UIRelativeBox.cpp" />
<ClCompile Include="..\UIScale9Sprite.cpp" />

View File

@ -96,6 +96,9 @@
<ClInclude Include="..\UIEditBox\UIEditBoxImpl-wp8.h">
<Filter>UIWidgets</Filter>
</ClInclude>
<ClInclude Include="..\UILayoutComponent.h">
<Filter>Layouts</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\ui\UILayout.cpp">
@ -176,5 +179,8 @@
<ClCompile Include="..\UIEditBox\UIEditBoxImpl-wp8.cpp">
<Filter>UIWidgets</Filter>
</ClCompile>
<ClCompile Include="..\UILayoutComponent.cpp">
<Filter>Layouts</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -1,5 +1,5 @@
{
"version":"v3-deps-14",
"version":"v3-deps-15",
"zip_file_size":"70810291",
"repo_name":"cocos2d-x-3rd-party-libs-bin",
"repo_parent":"https://github.com/cocos2d/",

View File

@ -99,7 +99,7 @@
<AdditionalDependencies>d3d11.lib;libGLESv2_phone.lib;libEGL_phone.lib;xaudio2.lib;libwebsockets.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\angle\prebuilt\$(Platform);$(EngineRoot)\external\curl\prebuilt\wp8\$(Platform);$(EngineRoot)external\websockets\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\angle\prebuilt\$(Platform);$(EngineRoot)\external\curl\prebuilt\wp8\$(Platform);$(EngineRoot)external\websockets\prebuilt\wp8\$(Platform);$(EngineRoot)external\protocolBuf\prebuilt\wp8\$(Platform)\debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -120,7 +120,7 @@
<AdditionalDependencies>d3d11.lib;libGLESv2_phone.lib;libEGL_phone.lib;xaudio2.lib;libwebsockets.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\angle\prebuilt\$(Platform);$(EngineRoot)\external\curl\prebuilt\wp8\$(Platform);$(EngineRoot)external\websockets\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\angle\prebuilt\$(Platform);$(EngineRoot)\external\curl\prebuilt\wp8\$(Platform);$(EngineRoot)external\websockets\prebuilt\wp8\$(Platform);$(EngineRoot)external\protocolBuf\prebuilt\wp8\$(Platform)\release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">

View File

@ -150,7 +150,7 @@ void ActionTimelineTestLayer::onExit()
backItem = restartItem = nextItem = nullptr;
ActionTimelineCache::getInstance()->purge();
NodeReader::getInstance()->purge();
CSLoader::getInstance()->purge();
Layer::onExit();
}
@ -196,8 +196,8 @@ void TestActionTimeline::onEnter()
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("armature/Cowboy0.plist", "armature/Cowboy0.png");
Node* node = NodeReader::getInstance()->createNode("ActionTimeline/boy_1.ExportJson");
ActionTimeline* action = ActionTimelineCache::getInstance()->createAction("ActionTimeline/boy_1.ExportJson");
Node* node = CSLoader::createNode("ActionTimeline/boy_1.csb");
ActionTimeline* action = CSLoader::createTimeline("ActionTimeline/boy_1.csb");
node->runAction(action);
action->gotoFrameAndPlay(0, 60, true);
@ -222,8 +222,8 @@ void TestChangePlaySection::onEnter()
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("armature/Cowboy0.plist", "armature/Cowboy0.png");
Node* node = NodeReader::getInstance()->createNode("ActionTimeline/boy_1.ExportJson");
action = ActionTimelineCache::getInstance()->createAction("ActionTimeline/boy_1.ExportJson");
Node* node = CSLoader::createNode("ActionTimeline/boy_1.csb");
action = CSLoader::createTimeline("ActionTimeline/boy_1.csb");
node->runAction(action);
action->gotoFrameAndPlay(70, action->getDuration(), true);
@ -260,8 +260,8 @@ void TestTimelineFrameEvent::onEnter()
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("armature/Cowboy0.plist", "armature/Cowboy0.png");
Node* node = NodeReader::getInstance()->createNode("ActionTimeline/boy_1.ExportJson");
ActionTimeline* action = ActionTimelineCache::getInstance()->createAction("ActionTimeline/boy_1.ExportJson");
Node* node = CSLoader::createNode("ActionTimeline/boy_1.csb");
ActionTimeline* action = CSLoader::createTimeline("ActionTimeline/boy_1.csb");
node->runAction(action);
action->gotoFrameAndPlay(0, 60, true);
@ -306,8 +306,8 @@ void TestTimelinePerformance::onEnter()
for (int i = 0; i< 100; i++)
{
Node* node = NodeReader::getInstance()->createNode("ActionTimeline/boy_1.ExportJson");
ActionTimeline* action = ActionTimelineCache::getInstance()->createAction("ActionTimeline/boy_1.ExportJson");
Node* node = CSLoader::createNode("ActionTimeline/boy_1.csb");
ActionTimeline* action = CSLoader::createTimeline("ActionTimeline/boy_1.csb");
node->runAction(action);
action->gotoFrameAndPlay(70, action->getDuration(), true);

View File

@ -173,7 +173,8 @@ g_guisTests[] =
UISceneManager_Editor* pManager = UISceneManager_Editor::sharedUISceneManager_Editor();
pManager->setCurrentUISceneId(kUILayoutTest_Editor);
pManager->setMinUISceneId(kUILayoutTest_Editor);
pManager->setMaxUISceneId(kUILayoutTest_Layout_Relative_Location_Editor);
pManager->setMaxUISceneId(kUILayoutTest_BackGroundImage_Scale9_Editor);
// pManager->setMaxUISceneId(kUILayoutTest_Layout_Relative_Location_Editor);
Scene* pScene = pManager->currentUIScene();
Director::getInstance()->replaceScene(pScene);
}
@ -202,6 +203,7 @@ g_guisTests[] =
Director::getInstance()->replaceScene(pScene);
}
},
/*
{
"gui ListView Editor Test",
[](Ref* sender)
@ -214,6 +216,7 @@ g_guisTests[] =
Director::getInstance()->replaceScene(pScene);
}
},
*/
/*
{
"gui GridViewTest",

View File

@ -20,20 +20,64 @@ void UIButtonTest_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIButton_Editor/UIButton_Editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIButton_Editor/UIButton_Editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIButton_Editor/windows_UIButton_Editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIButton_Editor/windows_UIButton_Editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIButton_Editor/crossplatform_UIButton_Editor_1.ExportJson");
Node* child = node->getChildByTag(4);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIButton_Editor/crossplatform_UIButton_Editor_1.csb");
Node* child = node->getChildByTag(4);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -66,7 +110,10 @@ bool UIButtonTest_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIButton_Editor/UIButton_Editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIButton_Editor/crossplatform_UIButton_Editor_1.csb");
Node* child = node->getChildByTag(4);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();

View File

@ -20,20 +20,64 @@ void UICheckBoxTest_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UICheckBox_Editor/ui_checkbox_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UICheckBox_Editor/ui_checkbox_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UICheckBox_Editor/windows_ui_checkbox_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UICheckBox_Editor/windows_ui_checkbox_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UICheckBox_Editor/crossplatform_UICheckBox_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UICheckBox_Editor/crossplatform_UICheckBox_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -60,9 +104,12 @@ bool UICheckBoxTest_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UICheckBox_Editor/ui_checkbox_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UICheckBox_Editor/crossplatform_UICheckBox_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
_displayValueLabel = Text::create();

View File

@ -8,20 +8,64 @@ void UIImageViewTest_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIImageView_Editor/ui_ImageView_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIImageView_Editor/ui_ImageView_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIImageView_Editor/windows_ui_ImageView_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIImageView_Editor/windows_ui_ImageView_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIImageView_Editor/crossplatform_UIImageView_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIImageView_Editor/crossplatform_UIImageView_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -45,11 +89,12 @@ bool UIImageViewTest_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIImageView_Editor/ui_ImageView_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIImageView_Editor/crossplatform_UIImageView_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
return true;

View File

@ -1,6 +1,7 @@
#include "UILayoutTest_Editor.h"
#include "VisibleRect.h"
// UILayoutTest_Editor
@ -19,20 +20,64 @@ void UILayoutTest_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/ui_layout_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/ui_layout_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/windows_ui_layout_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/windows_ui_layout_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/crossplatform_UILayout_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/crossplatform_UILayout_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -75,11 +120,21 @@ bool UILayoutTest_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/ui_layout_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/crossplatform_UILayout_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
/*
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 3.75f));
*/
return true;
}
@ -103,20 +158,64 @@ void UILayoutTest_Color_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Color_Editor/ui_layout_color_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Color_Editor/ui_layout_color_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Color_Editor/windows_ui_layout_color_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Color_Editor/windows_ui_layout_color_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Color_Editor/crossplatform_UILayout_Color_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Color_Editor/crossplatform_UILayout_Color_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -157,10 +256,21 @@ bool UILayoutTest_Color_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Color_Editor/ui_layout_color_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Color_Editor/crossplatform_UILayout_Color_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
/*
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 3.75f));
*/
return true;
}
@ -184,20 +294,64 @@ void UILayoutTest_Gradient_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Gradient_Color_Editor/ui_layout_gradient_color_editor_1_0.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Gradient_Color_Editor/ui_layout_gradient_color_editor_1_0.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Gradient_Color_Editor/windows_ui_layout_gradient_color_editor_1_0.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Gradient_Color_Editor/windows_ui_layout_gradient_color_editor_1_0.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Gradient_Color_Editor/crossplatform_UILayout_Gradient_Color_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Gradient_Color_Editor/crossplatform_UILayout_Gradient_Color_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -239,10 +393,21 @@ bool UILayoutTest_Gradient_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Gradient_Color_Editor/ui_layout_gradient_color_editor_1_0.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Gradient_Color_Editor/crossplatform_UILayout_Gradient_Color_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
/*
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 3.75f));
*/
return true;
}
@ -266,20 +431,64 @@ void UILayoutTest_BackGroundImage_Editor::switchLoadMethod(cocos2d::Ref *pSender
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_BackgroundImage_Editor/ui_layout_backgroundimage_editor_1_0_0.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_BackgroundImage_Editor/ui_layout_backgroundimage_editor_1_0_0.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_BackgroundImage_Editor/windows_ui_layout_backgroundimage_editor_1_0_0.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_BackgroundImage_Editor/windows_ui_layout_backgroundimage_editor_1_0_0.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_BackgroundImage_Editor/crossplatform_UILayout_BackgroundImage_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_BackgroundImage_Editor/crossplatform_UILayout_BackgroundImage_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -321,11 +530,21 @@ bool UILayoutTest_BackGroundImage_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_BackgroundImage_Editor/ui_layout_backgroundimage_editor_1_0_0.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_BackgroundImage_Editor/crossplatform_UILayout_BackgroundImage_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
/*
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 3.75f));
*/
return true;
}
@ -349,20 +568,64 @@ void UILayoutTest_BackGroundImage_Scale9_Editor::switchLoadMethod(cocos2d::Ref *
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Scale9_BackgroundImage_Editor/ui_layout_scale9_backgroundimage_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Scale9_BackgroundImage_Editor/ui_layout_scale9_backgroundimage_editor.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Scale9_BackgroundImage_Editor/windows_ui_layout_scale9_backgroundimage_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Scale9_BackgroundImage_Editor/windows_ui_layout_scale9_backgroundimage_editor.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Scale9_BackgroundImage_Editor/crossplatform_UILayout_Scale9_BackgroundImage_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Scale9_BackgroundImage_Editor/crossplatform_UILayout_Scale9_BackgroundImage_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -404,11 +667,21 @@ bool UILayoutTest_BackGroundImage_Scale9_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Scale9_BackgroundImage_Editor/ui_layout_scale9_backgroundimage_editor.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Scale9_BackgroundImage_Editor/crossplatform_UILayout_Scale9_BackgroundImage_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
/*
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 4.25f));
*/
return true;
}
@ -432,20 +705,64 @@ void UILayoutTest_Layout_Linear_Vertical_Editor::switchLoadMethod(cocos2d::Ref *
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Vertical_Layout_Editor/ui_layout_linear_vertical_layout_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Vertical_Layout_Editor/ui_layout_linear_vertical_layout_editor.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Vertical_Layout_Editor/windows_ui_layout_linear_vertical_layout_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Vertical_Layout_Editor/windows_ui_layout_linear_vertical_layout_editor.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Vertical_Layout_Editor/crossplatform_UILayout_Linear_Vertical_Layout_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Vertical_Layout_Editor/crossplatform_UILayout_Linear_Vertical_Layout_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -487,11 +804,17 @@ bool UILayoutTest_Layout_Linear_Vertical_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Vertical_Layout_Editor/ui_layout_linear_vertical_layout_editor.json"));
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Vertical_Layout_Editor/windows_ui_layout_linear_vertical_layout_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 4.25f));
return true;
}
@ -515,20 +838,64 @@ void UILayoutTest_Layout_Linear_Horizontal_Editor::switchLoadMethod(cocos2d::Ref
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Horizontal_Layout_Editor/ui_layout_linear_horizontal_layout_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Horizontal_Layout_Editor/ui_layout_linear_horizontal_layout_editor.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Horizontal_Layout_Editor/windows_ui_layout_linear_horizontal_layout_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Horizontal_Layout_Editor/windows_ui_layout_linear_horizontal_layout_editor.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Horizontal_Layout_Editor/crossplatform_UILayout_Linear_Horizontal_Layout_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Horizontal_Layout_Editor/crossplatform_UILayout_Linear_Horizontal_Layout_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -570,11 +937,16 @@ bool UILayoutTest_Layout_Linear_Horizontal_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Horizontal_Layout_Editor/ui_layout_linear_horizontal_layout_editor.json"));
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Horizontal_Layout_Editor/windows_ui_layout_linear_horizontal_layout_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 4.25f));
return true;
}
@ -598,20 +970,64 @@ void UILayoutTest_Layout_Relative_Align_Parent_Editor::switchLoadMethod(cocos2d:
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Parent_Editor/ui_layout_relative_align_parent_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Parent_Editor/ui_layout_relative_align_parent_editor.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Parent_Editor/windows_ui_layout_relative_align_parent_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Parent_Editor/windows_ui_layout_relative_align_parent_editor.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Parent_Editor/crossplatform_UILayout_Relative_Align_Parent_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Parent_Editor/crossplatform_UILayout_Relative_Align_Parent_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -653,10 +1069,15 @@ bool UILayoutTest_Layout_Relative_Align_Parent_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Parent_Editor/ui_layout_relative_align_parent_editor.json"));
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Parent_Editor/windows_ui_layout_relative_align_parent_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 4.25f));
return true;
}
@ -680,20 +1101,64 @@ void UILayoutTest_Layout_Relative_Location_Editor::switchLoadMethod(cocos2d::Ref
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Location_Editor/ui_layout_relative_align_location_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Location_Editor/ui_layout_relative_align_location_editor.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Location_Editor/windows_ui_layout_relative_align_location_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Location_Editor/windows_ui_layout_relative_align_location_editor.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Location_Editor/crossplatform_UILayout_Relative_Align_Location_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Location_Editor/crossplatform_UILayout_Relative_Align_Location_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -735,9 +1200,15 @@ bool UILayoutTest_Layout_Relative_Location_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Location_Editor/ui_layout_relative_align_location_editor.json"));
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Location_Editor/windows_ui_layout_relative_align_location_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 4.25f));
return true;
}

View File

@ -1,5 +1,6 @@
#include "UIListViewTest_Editor.h"
#include "VisibleRect.h"
// UIListViewTest_Vertical_Editor
@ -19,20 +20,64 @@ void UIListViewTest_Vertical_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/ui_listview_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/ui_listview_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/windows_ui_listview_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/windows_ui_listview_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/crossplatform_UIListView_Vertical_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/crossplatform_UIListView_Vertical_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -79,10 +124,15 @@ bool UIListViewTest_Vertical_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/ui_listview_editor_1.json"));
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/windows_ui_listview_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 4.25f));
return true;
}
@ -102,20 +152,64 @@ void UIListViewTest_Horizontal_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Horizontal_Editor/ui_listview_horizontal_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Horizontal_Editor/ui_listview_horizontal_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Horizontal_Editor/windows_ui_listview_horizontal_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Horizontal_Editor/windows_ui_listview_horizontal_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIListView_Editor/UIListView_Horizontal_Editor/crossplatform_UIListView_Horizontal_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIListView_Editor/UIListView_Horizontal_Editor/crossplatform_UIListView_Horizontal_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -162,10 +256,16 @@ bool UIListViewTest_Horizontal_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Horizontal_Editor/ui_listview_horizontal_editor_1.json"));
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Horizontal_Editor/windows_ui_listview_horizontal_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 4.25f));
return true;
}

View File

@ -21,20 +21,64 @@ void UILoadingBarTest_Editor::switchLoadMethod(cocos2d::Ref *pSender)
MenuItemToggle *item = (MenuItemToggle*)pSender;
_count = 0;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILoadingBar_Editor/ui_loadingbar_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILoadingBar_Editor/ui_loadingbar_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILoadingBar_Editor/windows_ui_loadingbar_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILoadingBar_Editor/windows_ui_loadingbar_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILoadingBar_Editor/crossplatform_UILoadingBar_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILoadingBar_Editor/crossplatform_UILoadingBar_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -67,10 +111,14 @@ bool UILoadingBarTest_Editor::init()
{
scheduleUpdate();
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILoadingBar_Editor/ui_loadingbar_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILoadingBar_Editor/crossplatform_UILoadingBar_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
return true;
}

View File

@ -1,6 +1,7 @@
#include "UIPageViewTest_Editor.h"
#include "VisibleRect.h"
// UIPageViewTest_Editor
@ -20,21 +21,66 @@ void UIPageViewTest_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIPageView_Editor/ui_pageview_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIPageView_Editor/ui_pageview_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIPageView_Editor/windows_ui_pageview_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIPageView_Editor/windows_ui_pageview_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIPageView_Editor/crossplatform_UIPageView_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIPageView_Editor/crossplatform_UIPageView_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -76,10 +122,21 @@ bool UIPageViewTest_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIPageView_Editor/ui_pageview_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIPageView_Editor/crossplatform_UIPageView_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
/*
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 3.75f));
*/
return true;
}

View File

@ -36,12 +36,14 @@ static const char* s_testArray[] =
"UILayoutTest_Gradient_Editor",
"UILayoutTest_BackGroundImage_Editor",
"UILayoutTest_BackGroundImage_Scale9_Editor",
/*
"UILayoutTest_Layout_Linear_Vertical_Editor",
"UILayoutTest_Layout_Linear_Horizontal_Editor",
"UILayoutTest_Layout_Relative_Align_Parent_Editor",
"UILayoutTest_Layout_Relative_Location_Editor",
"UIListViewTest_Vertical_Editor",
"UIListViewTest_Horizontal_Editor",
*/
"UIPageViewTest_Editor",
"UIScrollViewTest_Vertical_Editor",
"UIScrollViewTest_Horizontal_Editor",
@ -147,6 +149,7 @@ Scene* UISceneManager_Editor::currentUIScene()
case kUILayoutTest_BackGroundImage_Scale9_Editor:
return UILayoutTest_BackGroundImage_Scale9_Editor::sceneWithTitle(s_testArray[_currentUISceneId]);
/*
case kUILayoutTest_Layout_Linear_Vertical_Editor:
return UILayoutTest_Layout_Linear_Vertical_Editor::sceneWithTitle(s_testArray[_currentUISceneId]);
@ -164,6 +167,7 @@ Scene* UISceneManager_Editor::currentUIScene()
case kUIListViewTest_Horizontal_Editor:
return UIListViewTest_Horizontal_Editor::sceneWithTitle(s_testArray[_currentUISceneId]);
*/
case kUIPageViewTest_Editor:
return UIPageViewTest_Editor::sceneWithTitle(s_testArray[_currentUISceneId]);

View File

@ -46,12 +46,14 @@ enum
kUILayoutTest_Gradient_Editor,
kUILayoutTest_BackGroundImage_Editor,
kUILayoutTest_BackGroundImage_Scale9_Editor,
/*
kUILayoutTest_Layout_Linear_Vertical_Editor,
kUILayoutTest_Layout_Linear_Horizontal_Editor,
kUILayoutTest_Layout_Relative_Align_Parent_Editor,
kUILayoutTest_Layout_Relative_Location_Editor,
kUIListViewTest_Vertical_Editor,
kUIListViewTest_Horizontal_Editor,
*/
kUIPageViewTest_Editor,
kUIScrollViewTest_Vertical_Editor,
kUIScrollViewTest_Horizontal_Editor,

View File

@ -27,24 +27,34 @@ bool UIScene_Editor::init()
addChild(_touchGroup);
//add switch
MenuItem* pLoadJsonItem = MenuItemFont::create("Switch to Binary Load");
MenuItem* pLoadBinaryItem = MenuItemFont::create("Switch to Json Load");
MenuItem* pLoadJsonItem = MenuItemFont::create("Switch to Windows Json Load");
MenuItem* pLoadBinaryItem = MenuItemFont::create("Switch to Windows Binary Load");
MenuItem* pLoadJsonItemCrossPlatForm = MenuItemFont::create("Switch to Cross PlatForm Json Load");
MenuItem* pLoadBinaryItemCrossPlatForm = MenuItemFont::create("Switch to Cross PlatForm Binary Load");
pLoadJsonItem->setTag(1);
pLoadBinaryItem->setTag(2);
pLoadJsonItemCrossPlatForm->setTag(3);
pLoadBinaryItemCrossPlatForm->setTag(4);
Vector<MenuItem*> array;;
array.pushBack(pLoadJsonItem);
array.pushBack(pLoadBinaryItem);
array.pushBack(pLoadJsonItemCrossPlatForm);
array.pushBack(pLoadBinaryItemCrossPlatForm);
array.pushBack(pLoadJsonItem);
MenuItemToggle *pToggleItem = MenuItemToggle::createWithCallback(CC_CALLBACK_1(UIScene_Editor::switchLoadMethod,this), array);
pToggleItem->setPosition(Vec2(VisibleRect::right().x - 150, VisibleRect::top().y - 50));;
pToggleItem->setTag(1);
MenuItem* selectedItem = pToggleItem->getSelectedItem();
pToggleItem->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y - selectedItem->getContentSize().height * 3.75f));
Menu* pMenu =Menu::create(pToggleItem, nullptr);
pMenu->setPosition( Vec2::ZERO );
addChild(pMenu, 1);
// addChild(pMenu, 1, 1);
return true;
}

View File

@ -1,6 +1,7 @@
#include "UIScrollViewTest_Editor.h"
#include "VisibleRect.h"
// UIScrollViewTest_Vertical_Editor
@ -19,21 +20,66 @@ void UIScrollViewTest_Vertical_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/ui_scrollview_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/ui_scrollview_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/windows_ui_scrollview_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/windows_ui_scrollview_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/crossplatform_UIScrollView_Vertical_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/crossplatform_UIScrollView_Vertical_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -75,10 +121,21 @@ bool UIScrollViewTest_Vertical_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/ui_scrollview_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/crossplatform_UIScrollView_Vertical_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
/*
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 3.75f));
*/
return true;
}
@ -102,21 +159,66 @@ void UIScrollViewTest_Horizontal_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Horizontal_Editor/ui_scrollview_horizontal_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Horizontal_Editor/ui_scrollview_horizontal_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Horizontal_Editor/windows_ui_scrollview_horizontal_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Horizontal_Editor/windows_ui_scrollview_horizontal_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Horizontal_Editor/crossplatform_UIScrollView_Horizontal_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Horizontal_Editor/crossplatform_UIScrollView_Horizontal_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -159,9 +261,21 @@ bool UIScrollViewTest_Horizontal_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Horizontal_Editor/ui_scrollview_horizontal_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Horizontal_Editor/crossplatform_UIScrollView_Horizontal_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
/*
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 3.75f));
*/
return true;
}
@ -185,21 +299,66 @@ void UIScrollViewTest_Both_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Both_Editor/ui_scrollview_both_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Both_Editor/ui_scrollview_both_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Both_Editor/windows_ui_scrollview_both_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Both_Editor/windows_ui_scrollview_both_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Both_Editor/crossplatform_UIScrollView_Both_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Both_Editor/crossplatform_UIScrollView_Both_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -240,9 +399,21 @@ bool UIScrollViewTest_Both_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Both_Editor/ui_scrollview_both_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Both_Editor/crossplatform_UIScrollView_Both_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
/*
Menu* menu = static_cast<Menu*>(getChildByTag(1));
MenuItemToggle* menuItemToggle = static_cast<MenuItemToggle*>(menu->getChildByTag(1));
MenuItem* selectedItem = menuItemToggle->getSelectedItem();
menuItemToggle->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y + selectedItem->getContentSize().height * 3.75f));
*/
return true;
}

View File

@ -20,21 +20,66 @@ void UISliderTest_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UISlider_Editor/ui_slider_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UISlider_Editor/ui_slider_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UISlider_Editor/windows_ui_slider_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UISlider_Editor/windows_ui_slider_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UISlider_Editor/crossplatform_UISlider_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UISlider_Editor/crossplatform_UISlider_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -64,9 +109,12 @@ bool UISliderTest_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UISlider_Editor/ui_slider_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UISlider_Editor/crossplatform_UISlider_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
_displayValueLabel = Text::create();

View File

@ -7,21 +7,66 @@ void UITextAtlasTest_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabelAtlas_Editor/ui_labelatlas_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILabelAtlas_Editor/ui_labelatlas_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabelAtlas_Editor/windows_ui_labelatlas_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILabelAtlas_Editor/windows_ui_labelatlas_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILabelAtlas_Editor/crossplatform_UILabelAtlas_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILabelAtlas_Editor/crossplatform_UILabelAtlas_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -44,10 +89,14 @@ bool UITextAtlasTest_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabelAtlas_Editor/ui_labelatlas_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILabelAtlas_Editor/crossplatform_UILabelAtlas_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
return true;
}

View File

@ -8,21 +8,66 @@ void UITextBMFontTest_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabelBMFont_Editor/ui_labelbmfont_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILabelBMFont_Editor/ui_labelbmfont_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabelBMFont_Editor/windows_ui_labelbmfont_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILabelBMFont_Editor/windows_ui_labelbmfont_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILabelBMFont_Editor/crossplatform_UILabelBMFont_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILabelBMFont_Editor/crossplatform_UILabelBMFont_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -45,10 +90,14 @@ bool UITextBMFontTest_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabelBMFont_Editor/ui_labelbmfont_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILabelBMFont_Editor/crossplatform_UILabelBMFont_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
return true;
}

View File

@ -20,21 +20,66 @@ void UITextFieldTest_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UITextField_Editor/ui_textfield_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UITextField_Editor/ui_textfield_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UITextField_Editor/windows_ui_textfield_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UITextField_Editor/windows_ui_textfield_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UITextField_Editor/crossplatform_UITextField_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UITextField_Editor/crossplatform_UITextField_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -66,9 +111,12 @@ bool UITextFieldTest_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UITextField_Editor/ui_textfield_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UITextField_Editor/crossplatform_UITextField_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
_displayValueLabel = Text::create();

View File

@ -11,21 +11,66 @@ void UITextTest_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabel_Editor/ui_label_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILabel_Editor/ui_label_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabel_Editor/windows_ui_label_editor_1.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILabel_Editor/windows_ui_label_editor_1.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILabel_Editor/crossplatform_UILabel_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILabel_Editor/crossplatform_UILabel_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -49,9 +94,14 @@ bool UITextTest_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabel_Editor/ui_label_editor_1.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UILabel_Editor/crossplatform_UILabel_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
return true;
}

View File

@ -19,21 +19,66 @@ void UIWidgetAddNodeTest_Editor::switchLoadMethod(cocos2d::Ref *pSender)
{
MenuItemToggle *item = (MenuItemToggle*)pSender;
if (item->getSelectedIndex() == 0){
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIWidgetAddNode_Editor/ui_widget_add_node_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
}else{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIWidgetAddNode_Editor/ui_widget_add_node_editor.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
switch (item->getSelectedIndex())
{
case 0:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIWidgetAddNode_Editor/windows_ui_widget_add_node_editor.json"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 1:
{
_layout->removeFromParentAndCleanup(true);
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIWidgetAddNode_Editor/windows_ui_widget_add_node_editor.csb"));
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 2:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIWidgetAddNode_Editor/crossplatform_UIWidgetAddNode_Editor_1.ExportJson");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
case 3:
{
_layout->removeFromParentAndCleanup(true);
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIWidgetAddNode_Editor/crossplatform_UIWidgetAddNode_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
break;
}
default:
break;
}
}
@ -69,9 +114,14 @@ bool UIWidgetAddNodeTest_Editor::init()
{
if (UIScene_Editor::init())
{
_layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIWidgetAddNode_Editor/ui_widget_add_node_editor.json"));
Node* node = CSLoader::createNode("cocosui/UIEditorTest/UIWidgetAddNode_Editor/crossplatform_UIWidgetAddNode_Editor_1.csb");
Node* child = node->getChildByTag(5);
child->removeFromParent();
_layout = static_cast<Layout*>(child);
_touchGroup->addChild(_layout);
this->configureGUIScene();
return true;
}

Binary file not shown.

@ -1 +1 @@
Subproject commit c307f62357e42d2e7e671f4741f855dc8a5fde3a
Subproject commit 72970e16227dd624de4f9dd11395d4e510646441

View File

@ -4,7 +4,6 @@ NDK_TOOLCHAIN_VERSION=clang
APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char
APP_LDFLAGS := -latomic
ifeq ($(NDK_DEBUG),1)
APP_CPPFLAGS += -DCOCOS2D_DEBUG=1
APP_OPTIM := debug
@ -12,3 +11,4 @@ else
APP_CPPFLAGS += -DNDEBUG
APP_OPTIM := release
endif

View File

@ -11,22 +11,22 @@ target_namespace = ccs
cpp_namespace = cocostudio
android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/include
android_flags = -D_SIZE_T_DEFINED_
android_flags = -D_SIZE_T_DEFINED_
clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include
clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include
clang_flags = -nostdinc -x c++ -std=c++11 -U __SSE__
cocos_headers = -I%(cocosdir)s/external -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s/cocos/platform/android
cocos_flags = -DANDROID
cxxgenerator_headers =
cxxgenerator_headers =
# extra arguments for clang
extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s
extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s
# what headers to parse
headers = %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h
headers = %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h
# what classes to produce code for. You can use regular expressions here. When testing the regular
# expression, it will be enclosed in "^$", like this: "^Menu*$".
@ -52,8 +52,8 @@ skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*
ActionNode::[initWithDictionary],
ActionObject::[initWithDictionary initWithBinary],
BaseData::[copy subtract],
NodeReader::[getInstance],
ActionTimelineCache::[getInstance]
CSLoader::[getInstance nodeFromXML],
ActionTimelineCache::[getInstance loadActionTimelineFromXML]
rename_functions = GUIReader::[shareReader=getInstance purgeGUIReader=destroyInstance],
ActionManagerEx::[shareManager=getInstance purgeActionManager=destroyInstance],
@ -63,10 +63,10 @@ rename_functions = GUIReader::[shareReader=getInstance purgeGUIReader=destroyIn
rename_classes =
# for all class names, should we remove something when registering in the target VM?
remove_prefix =
remove_prefix =
# classes for which there will be no "parent" lookup
classes_have_no_parents =
classes_have_no_parents =
# base classes which will be skipped when their sub-classes found them.
base_classes_to_skip =
@ -77,4 +77,3 @@ abstract_classes = ArmatureDataManager ComAttribute ComRender ComAudio ActionMan
# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.
script_control_cpp = no