Merge pull request #13 from cocos2d/develop

update engine
This commit is contained in:
chuanweizhang2013 2014-03-12 16:15:51 +08:00
commit a1e80642bc
1025 changed files with 7776 additions and 1574 deletions

View File

@ -1 +1 @@
727d9ca089cf00365014b23ae2cf63341316ba7d
14c85247a5f8b18ac4e064c8afb58f55b58911f7

View File

@ -46,8 +46,8 @@ option(BUILD_EDITOR_SPINE "Build editor support for spine" ON)
option(BUILD_EDITOR_COCOSTUDIO "Build editor support for cocostudio" ON)
option(BUILD_EDITOR_COCOSBUILDER "Build editor support for cocosbuilder" ON)
option(BUILD_TestCpp "Only build TestCpp sample" ON)
option(BUILD_TestLua "Only build TestLua sample" OFF)
option(BUILD_CppTests "Only build TestCpp sample" ON)
option(BUILD_LuaTests "Only build TestLua sample" OFF)
else()#temp
option(USE_CHIPMUNK "Use chipmunk for physics library" ON)
@ -62,8 +62,8 @@ option(BUILD_EDITOR_SPINE "Build editor support for spine" ON)
option(BUILD_EDITOR_COCOSTUDIO "Build editor support for cocostudio" ON)
option(BUILD_EDITOR_COCOSBUILDER "Build editor support for cocosbuilder" ON)
option(BUILD_TestCpp "Only build TestCpp sample" ON)
option(BUILD_TestLua "Only build TestLua sample" ON)
option(BUILD_CppTests "Only build TestCpp sample" ON)
option(BUILD_LuaTests "Only build TestLua sample" ON)
endif()#temp
@ -144,6 +144,8 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/cocos/physics
${CMAKE_CURRENT_SOURCE_DIR}/cocos/editor-support
${CMAKE_CURRENT_SOURCE_DIR}/cocos/math/kazmath
${CMAKE_CURRENT_SOURCE_DIR}/cocos/scripting/lua-bindings/auto
${CMAKE_CURRENT_SOURCE_DIR}/cocos/scripting/lua-bindings/manual
${CMAKE_CURRENT_SOURCE_DIR}/extensions
${CMAKE_CURRENT_SOURCE_DIR}/external
${CMAKE_CURRENT_SOURCE_DIR}/external/tinyxml2
@ -244,8 +246,8 @@ add_subdirectory(cocos/storage)
endif(BUILD_STORAGE)
if(BUILD_GUI)
# gui
add_subdirectory(cocos/gui)
# ui
add_subdirectory(cocos/ui)
endif(BUILD_GUI)
if(BUILD_NETWORK)
@ -289,10 +291,14 @@ endif(BUILD_LIBS_LUA)
# build tests
if(BUILD_TestCpp)
add_subdirectory(samples/cpp-tests)
endif(BUILD_TestCpp)
add_subdirectory(tests/cpp-empty-test)
if(BUILD_TestLua)
add_subdirectory(samples/lua-tests/project)
endif(BUILD_TestLua)
if(BUILD_CppTests)
add_subdirectory(tests/cpp-tests)
endif(BUILD_CppTests)
add_subdirectory(tests/lua-empty-test/project)
if(BUILD_LuaTests)
add_subdirectory(tests/lua-tests/project)
endif(BUILD_LuaTests)

View File

@ -7,8 +7,8 @@ import os, os.path
import shutil
from optparse import OptionParser
CPP_SAMPLES = ['testcpp']
LUA_SAMPLES = ['testlua']
CPP_SAMPLES = ['cpp-empty-test', 'cpp-tests']
LUA_SAMPLES = ['lua-empty-test', 'lua-tests']
ALL_SAMPLES = CPP_SAMPLES + LUA_SAMPLES
def get_num_of_cpu():
@ -146,21 +146,34 @@ def copy_resources(target, app_android_root):
if os.path.isdir(assets_dir):
shutil.rmtree(assets_dir)
# copy resources(cpp samples and lua samples)
os.mkdir(assets_dir)
resources_dir = os.path.join(app_android_root, "../../res")
if os.path.isdir(resources_dir):
copy_files(resources_dir, assets_dir)
# copy resources(cpp samples)
if target in CPP_SAMPLES:
resources_dir = os.path.join(app_android_root, "../Resources")
if os.path.isdir(resources_dir):
copy_files(resources_dir, assets_dir)
# lua samples should copy lua script
if target in LUA_SAMPLES:
resources_dir = os.path.join(app_android_root, "../../res")
assets_res_dir = os.path.join(assets_dir, "res");
os.mkdir(assets_res_dir)
copy_files(resources_dir, assets_res_dir)
resources_dir = os.path.join(app_android_root, "../../src")
assets_src_dir = os.path.join(assets_dir, "src");
os.mkdir(assets_src_dir)
copy_files(resources_dir, assets_src_dir)
resources_dir = os.path.join(app_android_root, "../../../../cocos/scripting/lua-bindings/script")
copy_files(resources_dir, assets_dir)
# TestLua shared resources with TestCpp
if target == "testlua":
# lua-tests shared resources with cpp-tests
if target == "lua-tests":
resources_dir = os.path.join(app_android_root, "../../../cpp-tests/Resources")
copy_files(resources_dir, assets_dir)
copy_files(resources_dir, assets_res_dir)
def build_samples(target,ndk_build_param,android_platform,build_mode):
@ -186,11 +199,17 @@ def build_samples(target,ndk_build_param,android_platform,build_mode):
build_mode = 'debug'
app_android_root = ''
target_proj_path_map = {
"cpp-empty-test": "tests/cpp-empty-test/proj.android",
"cpp-tests": "tests/cpp-tests/proj.android",
"lua-empty-test": "tests/lua-empty-test/project/proj.android",
"lua-tests": "tests/lua-tests/project/proj.android"
}
for target in build_targets:
if target == 'testcpp':
app_android_root = os.path.join(cocos_root, 'samples/cpp-tests/proj.android')
elif target == 'testlua':
app_android_root = os.path.join(cocos_root, 'samples/lua-tests/project/proj.android')
if target in target_proj_path_map:
app_android_root = os.path.join(cocos_root, target_proj_path_map[target])
else:
print 'unknown target: %s' % target
continue
@ -205,14 +224,13 @@ if __name__ == '__main__':
usage = """
This script is mainy used for building tests built-in with cocos2d-x.
Usage: %prog [options] [testcpp|testlua]
Usage: %prog [options] [cpp-empty-test|cpp-tests|lua-empty-test|lua-tests]
If you are new to cocos2d-x, I recommend you start with testcpp, testlua.
If you are new to cocos2d-x, I recommend you start with cpp-empty-test, lua-empty-test.
You can combine these targets like this:
//1. to build simplegame and assetsmanager
python android-build.py -p 10 testcpp testlua
python android-build.py -p 10 cpp-empty-test lua-empty-test
Note: You should install ant to generate apk while building the andriod tests. But it is optional. You can generate apk with eclipse.

View File

@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Desktop
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libAudio", "..\cocos\audio\proj.win32\CocosDenshion.vcxproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}"
@ -11,14 +11,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\external\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "..\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCpp", "..\samples\cpp-tests\proj.win32\TestCpp.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests", "..\tests\cpp-tests\proj.win32\cpp-tests.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosBuilder", "..\cocos\editor-support\cocosbuilder\proj.win32\libCocosBuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosStudio", "..\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGUI", "..\cocos\gui\proj.win32\libGUI.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libNetwork", "..\cocos\network\proj.win32\libNetwork.vcxproj", "{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}"
@ -27,7 +25,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libLocalStorage", "..\cocos
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\cocos\scripting\lua-bindings\proj.win32\liblua.vcxproj", "{DDC3E27F-004D-4DD4-9DD3-931A013D2159}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLua", "..\samples\lua-tests\project\proj.win32\TestLua.win32.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua-tests", "..\tests\lua-tests\project\proj.win32\lua-tests.win32.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGUI", "..\cocos\ui\proj.win32\libGUI.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -67,10 +67,6 @@ Global
{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.Build.0 = Debug|Win32
{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.ActiveCfg = Release|Win32
{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.Build.0 = Release|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.ActiveCfg = Debug|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.Build.0 = Debug|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.ActiveCfg = Release|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.Build.0 = Release|Win32
{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Debug|Win32.ActiveCfg = Debug|Win32
{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Debug|Win32.Build.0 = Debug|Win32
{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Release|Win32.ActiveCfg = Release|Win32
@ -91,6 +87,10 @@ Global
{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.Build.0 = Debug|Win32
{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.ActiveCfg = Release|Win32
{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.Build.0 = Release|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.ActiveCfg = Debug|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.Build.0 = Debug|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.ActiveCfg = Release|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1 +1 @@
b8671f5532fbc91d62fd7acbae8b054fbc9816af
71a61fb97a4db05adaabc4cc03035fe419cc35d6

View File

@ -1 +0,0 @@
828f0bfcdb53dea52131e3bd9fb86ba153449816

View File

@ -0,0 +1 @@
08fd638cd925dfad54a49df207a72130942102d3

View File

@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A035ACBB1782469700987F6C"
BuildableName = "build all samples Mac"
BlueprintName = "build all samples Mac"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "build all tests Mac"
BlueprintName = "build all tests Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>

View File

@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A07A517B1783A1CC0073F6A7"
BuildableName = "build all samples iOS"
BlueprintName = "build all samples iOS"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "build all tests iOS"
BlueprintName = "build all tests iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE1C618CDF6DA004CD58F"
BuildableName = "cpp-empty-test Mac.app"
BlueprintName = "cpp-empty-test Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE1C618CDF6DA004CD58F"
BuildableName = "cpp-empty-test Mac.app"
BlueprintName = "cpp-empty-test Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE1C618CDF6DA004CD58F"
BuildableName = "cpp-empty-test Mac.app"
BlueprintName = "cpp-empty-test Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE1C618CDF6DA004CD58F"
BuildableName = "cpp-empty-test Mac.app"
BlueprintName = "cpp-empty-test Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE31818CDF775004CD58F"
BuildableName = "cpp-empty-test iOS.app"
BlueprintName = "cpp-empty-test iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE31818CDF775004CD58F"
BuildableName = "cpp-empty-test iOS.app"
BlueprintName = "cpp-empty-test iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE31818CDF775004CD58F"
BuildableName = "cpp-empty-test iOS.app"
BlueprintName = "cpp-empty-test iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE31818CDF775004CD58F"
BuildableName = "cpp-empty-test iOS.app"
BlueprintName = "cpp-empty-test iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "Test cpp Mac.app"
BlueprintName = "Test cpp Mac"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "cpp-tests Mac.app"
BlueprintName = "cpp-tests Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
@ -33,9 +33,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "Test cpp Mac.app"
BlueprintName = "Test cpp Mac"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "cpp-tests Mac.app"
BlueprintName = "cpp-tests Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
@ -52,9 +52,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "Test cpp Mac.app"
BlueprintName = "Test cpp Mac"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "cpp-tests Mac.app"
BlueprintName = "cpp-tests Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
@ -70,9 +70,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "Test cpp Mac.app"
BlueprintName = "Test cpp Mac"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "cpp-tests Mac.app"
BlueprintName = "cpp-tests Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>

View File

@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A07A517F1783A1D20073F6A7"
BuildableName = "Test cpp iOS.app"
BlueprintName = "Test cpp iOS"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "cpp-tests iOS.app"
BlueprintName = "cpp-tests iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
@ -33,9 +33,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A07A517F1783A1D20073F6A7"
BuildableName = "Test cpp iOS.app"
BlueprintName = "Test cpp iOS"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "cpp-tests iOS.app"
BlueprintName = "cpp-tests iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
@ -52,9 +52,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A07A517F1783A1D20073F6A7"
BuildableName = "Test cpp iOS.app"
BlueprintName = "Test cpp iOS"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "cpp-tests iOS.app"
BlueprintName = "cpp-tests iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
@ -70,9 +70,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A07A517F1783A1D20073F6A7"
BuildableName = "Test cpp iOS.app"
BlueprintName = "Test cpp iOS"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "cpp-tests iOS.app"
BlueprintName = "cpp-tests iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE2B818CDF733004CD58F"
BuildableName = "lua-empty-test Mac.app"
BlueprintName = "lua-empty-test Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE2B818CDF733004CD58F"
BuildableName = "lua-empty-test Mac.app"
BlueprintName = "lua-empty-test Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE2B818CDF733004CD58F"
BuildableName = "lua-empty-test Mac.app"
BlueprintName = "lua-empty-test Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE2B818CDF733004CD58F"
BuildableName = "lua-empty-test Mac.app"
BlueprintName = "lua-empty-test Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE41918CDF799004CD58F"
BuildableName = "lua-empty-test iOS.app"
BlueprintName = "lua-empty-test iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE41918CDF799004CD58F"
BuildableName = "lua-empty-test iOS.app"
BlueprintName = "lua-empty-test iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE41918CDF799004CD58F"
BuildableName = "lua-empty-test iOS.app"
BlueprintName = "lua-empty-test iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A0EE41918CDF799004CD58F"
BuildableName = "lua-empty-test iOS.app"
BlueprintName = "lua-empty-test iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1ABCA28518CD91510087CE3A"
BuildableName = "Test lua Mac.app"
BlueprintName = "Test lua Mac"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "lua-tests Mac.app"
BlueprintName = "lua-tests Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
@ -33,9 +33,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1ABCA28518CD91510087CE3A"
BuildableName = "Test lua Mac.app"
BlueprintName = "Test lua Mac"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "lua-tests Mac.app"
BlueprintName = "lua-tests Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
@ -52,9 +52,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1ABCA28518CD91510087CE3A"
BuildableName = "Test lua Mac.app"
BlueprintName = "Test lua Mac"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "lua-tests Mac.app"
BlueprintName = "lua-tests Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
@ -70,9 +70,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1ABCA28518CD91510087CE3A"
BuildableName = "Test lua Mac.app"
BlueprintName = "Test lua Mac"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "lua-tests Mac.app"
BlueprintName = "lua-tests Mac"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>

View File

@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1ABCA2CC18CD93580087CE3A"
BuildableName = "Test lua iOS.app"
BlueprintName = "Test lua iOS"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "lua-tests iOS.app"
BlueprintName = "lua-tests iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
@ -33,9 +33,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1ABCA2CC18CD93580087CE3A"
BuildableName = "Test lua iOS.app"
BlueprintName = "Test lua iOS"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "lua-tests iOS.app"
BlueprintName = "lua-tests iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
@ -52,9 +52,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1ABCA2CC18CD93580087CE3A"
BuildableName = "Test lua iOS.app"
BlueprintName = "Test lua iOS"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "lua-tests iOS.app"
BlueprintName = "lua-tests iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
@ -70,9 +70,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1ABCA2CC18CD93580087CE3A"
BuildableName = "Test lua iOS.app"
BlueprintName = "Test lua iOS"
ReferencedContainer = "container:cocos2d_samples.xcodeproj">
BuildableName = "lua-tests iOS.app"
BlueprintName = "lua-tests iOS"
ReferencedContainer = "container:cocos2d_tests.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>

View File

@ -524,7 +524,7 @@ EaseElasticIn* EaseElasticIn::clone() const
void EaseElasticIn::update(float time)
{
_inner->update(tweenfunc::elasticEaseIn(time, NULL));
_inner->update(tweenfunc::elasticEaseIn(time, _period));
}
EaseElastic* EaseElasticIn::reverse() const
@ -570,7 +570,7 @@ EaseElasticOut* EaseElasticOut::clone() const
void EaseElasticOut::update(float time)
{
_inner->update(tweenfunc::elasticEaseOut(time, NULL));
_inner->update(tweenfunc::elasticEaseOut(time, _period));
}
EaseElastic* EaseElasticOut::reverse() const
@ -616,7 +616,7 @@ EaseElasticInOut* EaseElasticInOut::clone() const
void EaseElasticInOut::update(float time)
{
_inner->update(tweenfunc::elasticEaseInOut(time, NULL));
_inner->update(tweenfunc::elasticEaseInOut(time, _period));
}
EaseElasticInOut* EaseElasticInOut::reverse() const

View File

@ -30,6 +30,7 @@
#include "CCFontFNT.h"
#include "CCFontFreeType.h"
#include "CCFontCharMap.h"
#include "CCDirector.h"
NS_CC_BEGIN
@ -58,7 +59,7 @@ FontAtlas * FontAtlasCache::getFontAtlasTTF(const TTFConfig & config)
if ( !tempAtlas )
{
FontFreeType *font = FontFreeType::create(config.fontFilePath, fontSize, config.glyphs, config.customGlyphs,useDistanceField,config.outlineSize);
FontFreeType *font = FontFreeType::create(config.fontFilePath, fontSize * CC_CONTENT_SCALE_FACTOR(), config.glyphs, config.customGlyphs,useDistanceField,config.outlineSize);
if (font)
{
tempAtlas = font->createFontAtlas();

View File

@ -50,6 +50,54 @@ Label* Label::create()
return ret;
}
Label* Label::createWithFontDefinition(const std::string& text, const FontDefinition &textDefinition)
{
auto ret = new Label();
if (ret)
{
ret->setFontDefinition(textDefinition);
ret->setString(text);
ret->autorelease();
}
return ret;
}
Label* Label::create(const std::string& text, const std::string& fontName, float fontSize, const Size& dimensions /* = Size::ZERO */, TextHAlignment hAlignment /* = TextHAlignment::LEFT */, TextVAlignment vAlignment /* = TextVAlignment::TOP */)
{
auto ret = new Label(nullptr,hAlignment);
if (ret)
{
do
{
if (fontName.find('.') != fontName.npos)
{
TTFConfig ttfConfig(fontName.c_str(),fontSize,GlyphCollection::DYNAMIC);
if (ret->setTTFConfig(ttfConfig))
{
break;
}
}
FontDefinition fontDef;
fontDef._fontName = fontName;
fontDef._fontSize = fontSize;
fontDef._dimensions = dimensions;
fontDef._alignment = hAlignment;
fontDef._vertAlignment = vAlignment;
ret->setFontDefinition(fontDef);
} while (0);
ret->setDimensions(dimensions.width,dimensions.height);
ret->setString(text);
ret->autorelease();
}
return ret;
}
Label* Label::createWithTTF(const TTFConfig& ttfConfig, const std::string& text, TextHAlignment alignment /* = TextHAlignment::CENTER */, int lineSize /* = 0 */)
{
Label *ret = new Label(nullptr,alignment);
@ -162,7 +210,13 @@ bool Label::setCharMap(const std::string& plistFile)
if (!newAtlas)
return false;
return initWithFontAtlas(newAtlas);
if (initWithFontAtlas(newAtlas))
{
_currentLabelType = LabelType::CHARMAP;
return true;
}
return false;
}
bool Label::setCharMap(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap)
@ -172,7 +226,13 @@ bool Label::setCharMap(Texture2D* texture, int itemWidth, int itemHeight, int st
if (!newAtlas)
return false;
return initWithFontAtlas(newAtlas);
if (initWithFontAtlas(newAtlas))
{
_currentLabelType = LabelType::CHARMAP;
return true;
}
return false;
}
bool Label::setCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap)
@ -182,7 +242,13 @@ bool Label::setCharMap(const std::string& charMapFile, int itemWidth, int itemHe
if (!newAtlas)
return false;
return initWithFontAtlas(newAtlas);
if (initWithFontAtlas(newAtlas))
{
_currentLabelType = LabelType::CHARMAP;
return true;
}
return false;
}
Label::Label(FontAtlas *atlas, TextHAlignment alignment, bool useDistanceField,bool useA8Shader)
@ -192,6 +258,7 @@ Label::Label(FontAtlas *atlas, TextHAlignment alignment, bool useDistanceField,b
, _maxLineWidth(0)
, _labelWidth(0)
, _labelHeight(0)
, _labelDimensions(Size::ZERO)
, _hAlignment(alignment)
, _currentUTF16String(nullptr)
, _originalUTF16String(nullptr)
@ -202,10 +269,20 @@ Label::Label(FontAtlas *atlas, TextHAlignment alignment, bool useDistanceField,b
, _useA8Shader(useA8Shader)
, _fontScale(1.0f)
, _uniformEffectColor(0)
,_currNumLines(-1)
, _currNumLines(-1)
, _textSprite(nullptr)
, _contentDirty(false)
, _currentLabelType(LabelType::STRING_TEXTURE)
, _currLabelEffect(LabelEffect::NORMAL)
, _shadowBlurRadius(0)
{
_cascadeColorEnabled = true;
_batchNodes.push_back(this);
_fontDefinition._fontName = "Helvetica";
_fontDefinition._fontSize = 12;
_fontDefinition._alignment = TextHAlignment::LEFT;
_fontDefinition._vertAlignment = TextVAlignment::TOP;
}
Label::~Label()
@ -301,11 +378,7 @@ bool Label::initWithFontAtlas(FontAtlas* atlas,bool distanceFieldEnabled /* = fa
if (_fontAtlas)
{
_commonLineHeight = _fontAtlas->getCommonLineHeight();
if(_currentUTF16String)
{
resetCurrentString();
alignText();
}
_contentDirty = true;
}
return ret;
@ -333,6 +406,7 @@ bool Label::setTTFConfig(const TTFConfig& ttfConfig)
{
this->setFontScale(1.0f * ttfConfig.fontSize / DefultFontSize);
}
_currentLabelType = LabelType::TTF;
return true;
}
else
@ -348,101 +422,74 @@ bool Label::setBMFontFilePath(const std::string& bmfontFilePath, const Point& im
if (!newAtlas)
return false;
return initWithFontAtlas(newAtlas);
if (initWithFontAtlas(newAtlas))
{
_currentLabelType = LabelType::BMFONT;
return true;
}
return false;
}
void Label::setFontDefinition(const FontDefinition& textDefinition)
{
_fontDefinition = textDefinition;
_currentLabelType = LabelType::STRING_TEXTURE;
_contentDirty = true;
}
void Label::setString(const std::string& text)
{
auto utf16String = cc_utf8_to_utf16(text.c_str());
if(utf16String)
{
_originalUTF8String = text;
setCurrentString(utf16String);
setOriginalString(utf16String);
alignText();
}
_originalUTF8String = text;
_contentDirty = true;
}
void Label::setAlignment(TextHAlignment hAlignment,bool aligntext /* = true */)
{
setAlignment(hAlignment,_vAlignment,aligntext);
}
inline void Label::setHorizontalAlignment(TextHAlignment hAlignment,bool aligntext /* = true */)
{
setAlignment(hAlignment,_vAlignment,aligntext);
}
inline void Label::setVerticalAlignment(TextVAlignment vAlignment,bool aligntext /* = true */)
{
setAlignment(_hAlignment,vAlignment,aligntext);
}
void Label::setAlignment(TextHAlignment hAlignment,TextVAlignment vAlignment,bool aligntext /* = true */)
void Label::setAlignment(TextHAlignment hAlignment,TextVAlignment vAlignment)
{
if (hAlignment != _hAlignment || vAlignment != _vAlignment)
{
_fontDefinition._alignment = hAlignment;
_fontDefinition._vertAlignment = vAlignment;
_hAlignment = hAlignment;
_vAlignment = vAlignment;
if (_currentUTF16String && aligntext)
{
resetCurrentString();
alignText();
}
_contentDirty = true;
}
}
void Label::setMaxLineWidth(unsigned int maxLineWidth)
{
if (_maxLineWidth != maxLineWidth)
if (_labelWidth == 0 && _maxLineWidth != maxLineWidth)
{
_maxLineWidth = maxLineWidth;
if (_currentUTF16String)
{
resetCurrentString();
alignText();
}
_contentDirty = true;
}
}
inline void Label::setWidth(unsigned int width)
{
setDimensions(width,_labelHeight);
}
inline void Label::setHeight(unsigned int height)
{
setDimensions(_labelWidth,height);
}
void Label::setDimensions(unsigned int width,unsigned int height)
{
if (height != _labelHeight || width != _labelWidth)
{
_labelHeight = height;
_fontDefinition._dimensions.width = width;
_fontDefinition._dimensions.height = height;
_labelWidth = width;
_labelHeight = height;
_labelDimensions.width = width;
_labelDimensions.height = height;
_maxLineWidth = width;
if (_currentUTF16String)
{
resetCurrentString();
alignText();
}
}
_contentDirty = true;
}
}
void Label::setLineBreakWithoutSpace(bool breakWithoutSpace)
{
if (breakWithoutSpace != _lineBreakWithoutSpaces)
{
// store
_lineBreakWithoutSpaces = breakWithoutSpace;
// need to align text again
if(_currentUTF16String)
{
resetCurrentString();
alignText();
}
_contentDirty = true;
}
}
@ -525,7 +572,7 @@ void Label::alignText()
if(_maxLineWidth > 0 && _contentSize.width > _maxLineWidth && LabelTextFormatter::multilineText(this) )
LabelTextFormatter::createStringSprites(this);
if(_labelWidth >0 || (_currNumLines > 1 && _hAlignment != TextHAlignment::LEFT))
if(_labelWidth > 0 || (_currNumLines > 1 && _hAlignment != TextHAlignment::LEFT))
LabelTextFormatter::alignText(this);
int strLen = cc_wcslen(_currentUTF16String);
@ -613,26 +660,11 @@ bool Label::setCurrentString(unsigned short *stringToSet)
computeStringNumLines();
// compute the advances
return computeHorizontalKernings(stringToSet);
}
void Label::resetCurrentString()
{
if ((!_currentUTF16String) && (!_originalUTF16String))
return;
// set the new string
if (_currentUTF16String)
if (_fontAtlas)
{
delete [] _currentUTF16String;
_currentUTF16String = 0;
computeHorizontalKernings(stringToSet);
}
int stringLenght = cc_wcslen(_originalUTF16String);
_currentUTF16String = new unsigned short int [stringLenght + 1];
memcpy(_currentUTF16String, _originalUTF16String, stringLenght * 2);
_currentUTF16String[stringLenght] = 0;
return true;
}
void Label::updateSpriteWithLetterDefinition(const FontLetterDefinition &theDefinition, Texture2D *theTexture)
@ -706,7 +738,7 @@ void Label::setLabelEffect(LabelEffect effect,const Color3B& effectColor)
void Label::enableGlow(const Color3B& glowColor)
{
if(_useDistanceField == false)
if(! _useDistanceField)
return;
_currLabelEffect = LabelEffect::GLOW;
_effectColor = glowColor;
@ -716,16 +748,26 @@ void Label::enableGlow(const Color3B& glowColor)
void Label::enableOutline(const Color4B& outlineColor,int outlineSize /* = 1 */)
{
_outlineColor = outlineColor;
if (outlineSize > 0)
{
_currLabelEffect = LabelEffect::OUTLINE;
if (_fontConfig.outlineSize != outlineSize)
if (_currentLabelType == LabelType::TTF)
{
_fontConfig.outlineSize = outlineSize;
setTTFConfig(_fontConfig);
if (_fontConfig.outlineSize != outlineSize)
{
auto config = _fontConfig;
config.outlineSize = outlineSize;
setTTFConfig(config);
initProgram();
}
}
initProgram();
}
_fontDefinition._stroke._strokeEnabled = true;
_fontDefinition._stroke._strokeSize = outlineSize;
_fontDefinition._stroke._strokeColor = Color3B(outlineColor.r,outlineColor.g,outlineColor.b);
_currLabelEffect = LabelEffect::OUTLINE;
_contentDirty = true;
}
}
void Label::enableShadow(const Color3B& shadowColor /* = Color3B::BLACK */,const Size &offset /* = Size(2 ,-2)*/, float opacity /* = 0.75f */, int blurRadius /* = 0 */)
@ -736,6 +778,13 @@ void Label::enableShadow(const Color3B& shadowColor /* = Color3B::BLACK */,const
//todo:support blur for shadow
_shadowBlurRadius = 0;
_currLabelEffect = LabelEffect::SHADOW;
_fontDefinition._shadow._shadowEnabled = true;
_fontDefinition._shadow._shadowBlur = blurRadius;
_fontDefinition._shadow._shadowOffset = offset;
_fontDefinition._shadow._shadowOpacity = opacity;
_contentDirty = true;
}
void Label::disableEffect()
@ -747,6 +796,7 @@ void Label::disableEffect()
}
_currLabelEffect = LabelEffect::NORMAL;
initProgram();
_contentDirty = true;
}
void Label::setFontScale(float fontScale)
@ -845,14 +895,61 @@ void Label::draw(Renderer *renderer, const kmMat4 &transform, bool transformUpda
renderer->addCommand(&_customCommand);
}
void Label::createSpriteWithFontDefinition()
{
_currentLabelType = LabelType::STRING_TEXTURE;
auto texture = new Texture2D;
#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS)
if (_fontDefinition._shadow._shadowEnabled || _fontDefinition._stroke._strokeEnabled)
{
CCLOGERROR("Currently only supported on iOS and Android!");
}
_fontDefinition._shadow._shadowEnabled = false;
_fontDefinition._stroke._strokeEnabled = false;
#endif
texture->initWithString(_originalUTF8String.c_str(),_fontDefinition);
_textSprite = Sprite::createWithTexture(texture);
_textSprite->setAnchorPoint(Point::ANCHOR_BOTTOM_LEFT);
this->setContentSize(_textSprite->getContentSize());
texture->release();
Node::addChild(_textSprite,0,Node::INVALID_TAG);
}
void Label::updateContent()
{
auto utf16String = cc_utf8_to_utf16(_originalUTF8String.c_str());
setCurrentString(utf16String);
setOriginalString(utf16String);
if (_textSprite)
{
Node::removeChild(_textSprite,true);
_textSprite = nullptr;
}
if (_fontAtlas)
{
alignText();
}
else
{
createSpriteWithFontDefinition();
}
_contentDirty = false;
}
void Label::visit(Renderer *renderer, const kmMat4 &parentTransform, bool parentTransformUpdated)
{
if (! _visible)
if (! _visible || _originalUTF8String.empty())
{
return;
}
if (_contentDirty)
{
updateContent();
}
if (_currLabelEffect == LabelEffect::SHADOW && _shadowBlurRadius <= 0)
if (! _textSprite && _currLabelEffect == LabelEffect::SHADOW && _shadowBlurRadius <= 0)
{
_parentTransform = parentTransform;
draw(renderer, _modelViewTransform, true);
@ -871,7 +968,14 @@ void Label::visit(Renderer *renderer, const kmMat4 &parentTransform, bool parent
kmGLPushMatrix();
kmGLLoadMatrix(&_modelViewTransform);
draw(renderer, _modelViewTransform, dirty);
if (_textSprite)
{
_textSprite->visit();
}
else
{
draw(renderer, _modelViewTransform, dirty);
}
kmGLPopMatrix();
}
@ -879,12 +983,87 @@ void Label::visit(Renderer *renderer, const kmMat4 &parentTransform, bool parent
setOrderOfArrival(0);
}
void Label::setFontName(const std::string& fontName)
{
if (fontName.find('.') != fontName.npos)
{
auto config = _fontConfig;
config.fontFilePath = fontName;
if (setTTFConfig(config))
{
return;
}
}
if (_fontDefinition._fontName != fontName)
{
_fontDefinition._fontName = fontName;
_contentDirty = true;
}
}
const std::string& Label::getFontName() const
{
switch (_currentLabelType)
{
case LabelType::TTF:
return _fontConfig.fontFilePath;
default:
return _fontDefinition._fontName;
}
}
void Label::setFontSize(int fontSize)
{
if (_currentLabelType == LabelType::TTF)
{
if (_fontConfig.fontSize == fontSize)
{
return;
}
if (_fontConfig.distanceFieldEnabled)
{
_fontConfig.fontSize = fontSize;
this->setFontScale(1.0f * fontSize / DefultFontSize);
}
else
{
auto fontConfig = _fontConfig;
fontConfig.fontSize = fontSize;
setTTFConfig(fontConfig);
}
}
else if(_fontDefinition._fontSize != fontSize)
{
_fontDefinition._fontSize = fontSize;
_fontConfig.fontSize = fontSize;
_contentDirty = true;
}
}
int Label::getFontSize() const
{
switch (_currentLabelType)
{
case LabelType::TTF:
return _fontConfig.fontSize;
case LabelType::STRING_TEXTURE:
return _fontDefinition._fontSize;
default:
return 0;
}
}
///// PROTOCOL STUFF
Sprite * Label::getLetter(int lettetIndex)
{
if (lettetIndex < _limitShowCount)
if (_contentDirty)
{
if(_lettersInfo[lettetIndex].def.validDefinition == false)
updateContent();
}
if (! _textSprite && lettetIndex < _limitShowCount)
{
if(! _lettersInfo[lettetIndex].def.validDefinition)
return nullptr;
Sprite* sp = static_cast<Sprite*>(this->getChildByTag(lettetIndex));
@ -913,13 +1092,7 @@ Sprite * Label::getLetter(int lettetIndex)
int Label::getCommonLineHeight() const
{
return _commonLineHeight;
}
// string related stuff
int Label::getStringNumLines() const
{
return _currNumLines;
return _textSprite ? 0 : _commonLineHeight;
}
void Label::computeStringNumLines()
@ -969,19 +1142,29 @@ void Label::setOpacityModifyRGB(bool isOpacityModifyRGB)
void Label::setColor(const Color3B& color)
{
_fontDefinition._fontFillColor = color;
if (_textSprite)
{
updateContent();
}
_reusedLetter->setColor(color);
SpriteBatchNode::setColor(color);
}
void Label::updateColor()
{
Color4B color4( _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity );
if (_textSprite)
{
_textSprite->setColor(_displayedColor);
_textSprite->setOpacity(_displayedOpacity);
}
if (nullptr == _textureAtlas)
{
return;
}
Color4B color4( _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity );
// special opacity for premultiplied textures
if (_isOpacityModifyRGB)
{
@ -1014,4 +1197,13 @@ std::string Label::getDescription() const
return StringUtils::format("<Label | Tag = %d, Label = '%s'>", _tag, cc_utf16_to_utf8(_currentUTF16String,-1,nullptr,nullptr));
}
const Size& Label::getContentSize() const
{
if (_contentDirty)
{
const_cast<Label*>(this)->updateContent();
}
return Node::getContentSize();
}
NS_CC_END

View File

@ -82,6 +82,13 @@ public:
static Label* create();
/** creates a Label from a font name, horizontal alignment, dimension in points, and font size in points.
* @warning It will generate texture by the platform-dependent code if [fontName] not a font file.
*/
static Label * create(const std::string& text, const std::string& fontName, float fontSize,
const Size& dimensions = Size::ZERO, TextHAlignment hAlignment = TextHAlignment::LEFT,
TextVAlignment vAlignment = TextVAlignment::TOP);
CC_DEPRECATED_ATTRIBUTE static Label* createWithTTF(const std::string& label, const std::string& fontFilePath,
int fontSize, int lineSize = 0, TextHAlignment alignment = TextHAlignment::LEFT,
GlyphCollection glyphs = GlyphCollection::NEHE, const char *customGlyphs = 0, bool useDistanceField = false);
@ -99,6 +106,12 @@ public:
static Label * createWithCharMap(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap);
static Label * createWithCharMap(const std::string& plistFile);
/** create a lable with string and a font definition
* @warning It will generate texture by the platform-dependent code and create Sprite for show text.
* To obtain better performance use createWithTTF/createWithBMFont/createWithCharMap
*/
static Label * createWithFontDefinition(const std::string& text, const FontDefinition &textDefinition);
/** set TTF configuration for Label */
virtual bool setTTFConfig(const TTFConfig& ttfConfig);
@ -108,14 +121,21 @@ public:
virtual bool setCharMap(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap);
virtual bool setCharMap(const std::string& plistFile);
/** set the text definition used by this label
* It will create Sprite for show text if you haven't set up using TTF/BMFont/CharMap.
*/
virtual void setFontDefinition(const FontDefinition& textDefinition);
/** get the text definition used by this label */
const FontDefinition& getFontDefinition() const { return _fontDefinition; }
/** 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.
*/
virtual void setString(const std::string& text) override;
virtual const std::string& getString() const override { return _originalUTF8String; }
CC_DEPRECATED_ATTRIBUTE void setLabelEffect(LabelEffect effect,const Color3B& effectColor);
/**
@ -135,43 +155,53 @@ public:
virtual void disableEffect();
virtual void setAlignment(TextHAlignment hAlignment,bool aligntext = true);
void setAlignment(TextHAlignment hAlignment) { setAlignment(hAlignment,_vAlignment);}
TextHAlignment getTextAlignment() const { return _hAlignment;}
virtual void setAlignment(TextHAlignment hAlignment,TextVAlignment vAlignment,bool aligntext = true);
void setAlignment(TextHAlignment hAlignment,TextVAlignment vAlignment);
virtual void setHorizontalAlignment(TextHAlignment alignment,bool aligntext = true);
void setHorizontalAlignment(TextHAlignment hAlignment) { setAlignment(hAlignment,_vAlignment); }
TextHAlignment getHorizontalAlignment() const { return _hAlignment; }
virtual void setVerticalAlignment(TextVAlignment verticalAlignment,bool aligntext = true);
void setVerticalAlignment(TextVAlignment vAlignment) { setAlignment(_hAlignment,vAlignment); }
TextVAlignment getVerticalAlignment() const { return _vAlignment; }
virtual void setLineBreakWithoutSpace(bool breakWithoutSpace);
void setLineBreakWithoutSpace(bool breakWithoutSpace);
/** Sets the max line width of the label.
* The label's max line width be used for force line breaks if the set value not equal zero.
* The label's width and max line width has not always to be equal.
*/
virtual void setMaxLineWidth(unsigned int maxLineWidth);
void setMaxLineWidth(unsigned int maxLineWidth);
unsigned int getMaxLineWidth() { return _maxLineWidth;}
/** Sets the untransformed size of the label.
* The label's width be used for text align if the set value not equal zero.
* The label's max line width will be equal to the same value.
*/
virtual void setWidth(unsigned int width);
void setWidth(unsigned int width) { setDimensions(width,_labelHeight);}
unsigned int getWidth() const { return _labelWidth; }
/** Sets the untransformed size of the label.
* The label's height be used for text align if the set value not equal zero.
* The text will display of incomplete when the size of label not enough to support display all text.
*/
virtual void setHeight(unsigned int height);
void setHeight(unsigned int height){ setDimensions(_labelWidth,height);}
unsigned int getHeight() const { return _labelHeight;}
/** Sets the untransformed size of the label in a more efficient way. */
virtual void setDimensions(unsigned int width,unsigned int height);
void setDimensions(unsigned int width,unsigned int height);
const Size& getDimensions() const{ return _labelDimensions;}
/** update content immediately.*/
virtual void updateContent();
virtual void setFontName(const std::string& fontName);
virtual const std::string& getFontName() const;
virtual void setFontSize(int fontSize);
virtual int getFontSize() const;
virtual bool isOpacityModifyRGB() const override;
virtual void setOpacityModifyRGB(bool isOpacityModifyRGB) override;
virtual void setColor(const Color3B& color) override;
@ -182,9 +212,9 @@ public:
int getCommonLineHeight() const;
// string related stuff
int getStringNumLines() const;
CC_DEPRECATED_ATTRIBUTE int getStringLenght() const { return getStringLength(); }
int getStringNumLines() const { return _currNumLines;}
int getStringLength() const;
CC_DEPRECATED_ATTRIBUTE int getStringLenght() const { return getStringLength(); }
virtual void visit(Renderer *renderer, const kmMat4 &parentTransform, bool parentTransformUpdated) override;
virtual void draw(Renderer *renderer, const kmMat4 &transform, bool transformUpdated) override;
@ -198,6 +228,8 @@ public:
virtual void addChild(Node * child, int zOrder=0, int tag=0) override;
virtual std::string getDescription() const override;
virtual const Size& getContentSize() const override;
protected:
void onDraw(const kmMat4& transform, bool transformUpdated);
@ -208,6 +240,14 @@ protected:
Point position;
Size contentSize;
};
enum class LabelType {
TTF,
BMFONT,
CHARMAP,
STRING_TEXTURE
};
/**
* @js NA
*/
@ -232,7 +272,6 @@ protected:
bool computeHorizontalKernings(unsigned short int *stringToRender);
bool setCurrentString(unsigned short *stringToSet);
bool setOriginalString(unsigned short *stringToSet);
void resetCurrentString();
void computeStringNumLines();
void updateSpriteWithLetterDefinition(const FontLetterDefinition &theDefinition, Texture2D *theTexture);
@ -243,7 +282,11 @@ protected:
void drawShadowWithoutBlur();
void createSpriteWithFontDefinition();
bool _isOpacityModifyRGB;
bool _contentDirty;
LabelType _currentLabelType;
std::vector<SpriteBatchNode*> _batchNodes;
FontAtlas * _fontAtlas;
@ -251,6 +294,10 @@ protected:
TTFConfig _fontConfig;
//compatibility with older LabelTTF
Sprite* _textSprite;
FontDefinition _fontDefinition;
//! used for optimization
Sprite *_reusedLetter;
Rect _reusedRect;
@ -261,6 +308,7 @@ protected:
int * _horizontalKernings;
unsigned int _maxLineWidth;
Size _labelDimensions;
unsigned int _labelWidth;
unsigned int _labelHeight;
TextHAlignment _hAlignment;

View File

@ -24,32 +24,20 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCLabelTTF.h"
#include "CCDirector.h"
#include "CCGLProgram.h"
#include "CCShaderCache.h"
#include "CCApplication.h"
#include "CCLabel.h"
#include "CCString.h"
NS_CC_BEGIN
#if CC_USE_LA88_LABELS
#define SHADER_PROGRAM GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR
#else
#define SHADER_PROGRAM GLProgram::SHADER_NAME_POSITION_TEXTUREA8Color
#endif
//
//CCLabelTTF
//
LabelTTF::LabelTTF()
: _alignment(TextHAlignment::CENTER)
, _vAlignment(TextVAlignment::TOP)
, _fontName("")
, _fontSize(0.0)
, _string("")
, _shadowEnabled(false)
, _strokeEnabled(false)
, _textFillColor(Color3B::WHITE)
{
_renderLabel = Label::create();
this->addChild(_renderLabel);
this->setAnchorPoint(Point::ANCHOR_MIDDLE);
_contentDirty = false;
_cascadeColorEnabled = true;
_cascadeOpacityEnabled = true;
}
LabelTTF::~LabelTTF()
@ -59,7 +47,7 @@ LabelTTF::~LabelTTF()
LabelTTF * LabelTTF::create()
{
LabelTTF * ret = new LabelTTF();
if (ret && ret->init())
if (ret)
{
ret->autorelease();
}
@ -70,18 +58,6 @@ LabelTTF * LabelTTF::create()
return ret;
}
LabelTTF * LabelTTF::create(const std::string& string, const std::string& fontName, float fontSize)
{
return LabelTTF::create(string, fontName, fontSize,
Size::ZERO, TextHAlignment::CENTER, TextVAlignment::TOP);
}
LabelTTF * LabelTTF::create(const std::string& string, const std::string& fontName, float fontSize,
const Size& dimensions, TextHAlignment hAlignment)
{
return LabelTTF::create(string, fontName, fontSize, dimensions, hAlignment, TextVAlignment::TOP);
}
LabelTTF* LabelTTF::create(const std::string& string, const std::string& fontName, float fontSize,
const Size &dimensions, TextHAlignment hAlignment,
TextVAlignment vAlignment)
@ -108,449 +84,189 @@ LabelTTF * LabelTTF::createWithFontDefinition(const std::string& string, FontDef
return nullptr;
}
bool LabelTTF::init()
{
return this->initWithString("", "Helvetica", 12);
}
bool LabelTTF::initWithString(const std::string& label, const std::string& fontName, float fontSize,
const Size& dimensions, TextHAlignment alignment)
{
return this->initWithString(label, fontName, fontSize, dimensions, alignment, TextVAlignment::TOP);
}
bool LabelTTF::initWithString(const std::string& label, const std::string& fontName, float fontSize)
{
return this->initWithString(label, fontName, fontSize,
Size::ZERO, TextHAlignment::LEFT, TextVAlignment::TOP);
}
bool LabelTTF::initWithString(const std::string& string, const std::string& fontName, float fontSize,
const cocos2d::Size &dimensions, TextHAlignment hAlignment,
TextVAlignment vAlignment)
{
if (Sprite::init())
{
// shader program
// this->setShaderProgram(ShaderCache::getInstance()->getProgram(SHADER_PROGRAM));
_renderLabel->setString(string);
_renderLabel->setFontSize(fontSize);
_renderLabel->setDimensions(dimensions.width,dimensions.height);
_renderLabel->setAlignment(hAlignment,vAlignment);
_renderLabel->setFontName(fontName);
this->setContentSize(_renderLabel->getContentSize());
_dimensions = Size(dimensions.width, dimensions.height);
_alignment = hAlignment;
_vAlignment = vAlignment;
_fontName = fontName;
_fontSize = fontSize;
this->setString(string);
return true;
}
return false;
return true;
}
bool LabelTTF::initWithStringAndTextDefinition(const std::string& string, FontDefinition &textDefinition)
{
if (Sprite::init())
{
// shader program
this->setShaderProgram(ShaderCache::getInstance()->getProgram(SHADER_PROGRAM));
// prepare everythin needed to render the label
_updateWithTextDefinition(textDefinition, false);
// set the string
this->setString(string);
//
return true;
}
else
{
return false;
}
_renderLabel->setFontDefinition(textDefinition);
_renderLabel->setString(string);
this->setContentSize(_renderLabel->getContentSize());
return true;
}
void LabelTTF::setString(const std::string &string)
{
if (_string.compare(string))
{
_string = string;
this->updateTexture();
}
_renderLabel->setString(string);
_contentDirty = true;
}
const std::string& LabelTTF::getString() const
{
return _string;
return _renderLabel->getString();
}
std::string LabelTTF::getDescription() const
{
return StringUtils::format("<LabelTTF | FontName = %s, FontSize = %.1f, Label = '%s'>", _fontName.c_str(), _fontSize, _string.c_str());
return StringUtils::format("<LabelTTF | FontName = %s, FontSize = %.1f, Label = '%s'>", _renderLabel->getFontName().c_str(), _renderLabel->getFontSize(), _renderLabel->getString().c_str());
}
TextHAlignment LabelTTF::getHorizontalAlignment() const
{
return _alignment;
return _renderLabel->getHorizontalAlignment();
}
void LabelTTF::setHorizontalAlignment(TextHAlignment alignment)
{
if (alignment != _alignment)
{
_alignment = alignment;
// Force update
if (_string.size() > 0)
{
this->updateTexture();
}
}
_renderLabel->setHorizontalAlignment(alignment);
_contentDirty = true;
}
TextVAlignment LabelTTF::getVerticalAlignment() const
{
return _vAlignment;
return _renderLabel->getVerticalAlignment();
}
void LabelTTF::setVerticalAlignment(TextVAlignment verticalAlignment)
{
if (verticalAlignment != _vAlignment)
{
_vAlignment = verticalAlignment;
// Force update
if (_string.size() > 0)
{
this->updateTexture();
}
}
_renderLabel->setVerticalAlignment(verticalAlignment);
_contentDirty = true;
}
const Size& LabelTTF::getDimensions() const
{
return _dimensions;
return _renderLabel->getDimensions();
}
void LabelTTF::setDimensions(const Size &dim)
{
// XXX: float comparison... very unreliable
if (dim.width != _dimensions.width || dim.height != _dimensions.height)
{
_dimensions = dim;
// Force update
if (_string.size() > 0)
{
this->updateTexture();
}
}
_renderLabel->setDimensions(dim.width,dim.height);
_contentDirty = true;
}
float LabelTTF::getFontSize() const
{
return _fontSize;
return _renderLabel->getFontSize();
}
void LabelTTF::setFontSize(float fontSize)
{
// XXX: float comparison... very unreliable
if (_fontSize != fontSize)
{
_fontSize = fontSize;
// Force update
if (_string.size() > 0)
{
this->updateTexture();
}
}
_renderLabel->setFontSize(fontSize);
_contentDirty = true;
}
const std::string& LabelTTF::getFontName() const
{
return _fontName;
return _renderLabel->getFontName();
}
void LabelTTF::setFontName(const std::string& fontName)
{
if (_fontName.compare(fontName))
{
_fontName = fontName;
// Force update
if (_string.size() > 0)
{
this->updateTexture();
}
}
}
// Helper
bool LabelTTF::updateTexture()
{
Texture2D *tex;
tex = new Texture2D();
if (!tex)
return false;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
FontDefinition texDef = _prepareTextDefinition(true);
tex->initWithString( _string.c_str(), texDef );
#else
tex->initWithString( _string.c_str(),
_fontName.c_str(),
_fontSize * CC_CONTENT_SCALE_FACTOR(),
CC_SIZE_POINTS_TO_PIXELS(_dimensions),
_alignment,
_vAlignment);
#endif
// set the texture
this->setTexture(tex);
// release it
tex->release();
// set the size in the sprite
Rect rect =Rect::ZERO;
rect.size = _texture->getContentSize();
this->setTextureRect(rect);
//ok
return true;
_renderLabel->setFontName(fontName);
_contentDirty = true;
}
void LabelTTF::enableShadow(const Size &shadowOffset, float shadowOpacity, float shadowBlur, bool updateTexture)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
bool valueChanged = false;
if (false == _shadowEnabled)
{
_shadowEnabled = true;
valueChanged = true;
}
if ( (_shadowOffset.width != shadowOffset.width) || (_shadowOffset.height!=shadowOffset.height) )
{
_shadowOffset.width = shadowOffset.width;
_shadowOffset.height = shadowOffset.height;
valueChanged = true;
}
if (_shadowOpacity != shadowOpacity )
{
_shadowOpacity = shadowOpacity;
valueChanged = true;
}
if (_shadowBlur != shadowBlur)
{
_shadowBlur = shadowBlur;
valueChanged = true;
}
if ( valueChanged && updateTexture )
{
this->updateTexture();
}
#else
CCLOGERROR("Currently only supported on iOS and Android!");
#endif
_renderLabel->enableShadow(Color3B::BLACK,shadowOffset,shadowOpacity,shadowBlur);
_contentDirty = true;
}
void LabelTTF::disableShadow(bool updateTexture)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
if (_shadowEnabled)
{
_shadowEnabled = false;
if (updateTexture)
this->updateTexture();
}
#else
CCLOGERROR("Currently only supported on iOS and Android!");
#endif
_renderLabel->disableEffect();
this->setContentSize(_renderLabel->getContentSize());
}
void LabelTTF::enableStroke(const Color3B &strokeColor, float strokeSize, bool updateTexture)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
bool valueChanged = false;
if(_strokeEnabled == false)
{
_strokeEnabled = true;
valueChanged = true;
}
if ( (_strokeColor.r != strokeColor.r) || (_strokeColor.g != strokeColor.g) || (_strokeColor.b != strokeColor.b) )
{
_strokeColor = strokeColor;
valueChanged = true;
}
if (_strokeSize!=strokeSize)
{
_strokeSize = strokeSize;
valueChanged = true;
}
if ( valueChanged && updateTexture )
{
this->updateTexture();
}
#else
CCLOGERROR("Currently only supported on iOS and Android!");
#endif
_renderLabel->enableOutline(Color4B(strokeColor),strokeSize);
_contentDirty = true;
}
void LabelTTF::disableStroke(bool updateTexture)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
if (_strokeEnabled)
{
_strokeEnabled = false;
if (updateTexture)
this->updateTexture();
}
#else
CCLOGERROR("Currently only supported on iOS and Android!");
#endif
_renderLabel->disableEffect();
this->setContentSize(_renderLabel->getContentSize());
}
void LabelTTF::setFontFillColor(const Color3B &tintColor, bool updateTexture)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
if (_textFillColor.r != tintColor.r || _textFillColor.g != tintColor.g || _textFillColor.b != tintColor.b)
{
_textFillColor = tintColor;
if (updateTexture)
this->updateTexture();
}
#else
CCLOGERROR("Currently only supported on iOS and Android!");
#endif
_renderLabel->setColor(tintColor);
this->setContentSize(_renderLabel->getContentSize());
}
void LabelTTF::setTextDefinition(const FontDefinition& theDefinition)
{
_updateWithTextDefinition(theDefinition, true);
_renderLabel->setFontDefinition(theDefinition);
_contentDirty = true;
}
FontDefinition LabelTTF::getTextDefinition()
const FontDefinition& LabelTTF::getTextDefinition() const
{
return _prepareTextDefinition(false);
return _renderLabel->getFontDefinition();
}
void LabelTTF::_updateWithTextDefinition(const FontDefinition& textDefinition, bool mustUpdateTexture)
void LabelTTF::setBlendFunc(const BlendFunc &blendFunc)
{
_dimensions = Size(textDefinition._dimensions.width, textDefinition._dimensions.height);
_alignment = textDefinition._alignment;
_vAlignment = textDefinition._vertAlignment;
_fontName = textDefinition._fontName;
_fontSize = textDefinition._fontSize;
// shadow
if ( textDefinition._shadow._shadowEnabled )
{
enableShadow(textDefinition._shadow._shadowOffset, textDefinition._shadow._shadowOpacity, textDefinition._shadow._shadowBlur, false);
}
// stroke
if ( textDefinition._stroke._strokeEnabled )
{
enableStroke(textDefinition._stroke._strokeColor, textDefinition._stroke._strokeSize, false);
}
// fill color
setFontFillColor(textDefinition._fontFillColor, false);
if (mustUpdateTexture)
updateTexture();
_renderLabel->setBlendFunc(blendFunc);
}
FontDefinition LabelTTF::_prepareTextDefinition(bool adjustForResolution)
const BlendFunc &LabelTTF::getBlendFunc() const
{
FontDefinition texDef;
if (adjustForResolution)
texDef._fontSize = _fontSize * CC_CONTENT_SCALE_FACTOR();
else
texDef._fontSize = _fontSize;
texDef._fontName = _fontName;
texDef._alignment = _alignment;
texDef._vertAlignment = _vAlignment;
if (adjustForResolution)
texDef._dimensions = CC_SIZE_POINTS_TO_PIXELS(_dimensions);
else
texDef._dimensions = _dimensions;
// stroke
if ( _strokeEnabled )
return _renderLabel->getBlendFunc();
}
void LabelTTF::setFlippedX(bool flippedX)
{
if (flippedX)
{
texDef._stroke._strokeEnabled = true;
texDef._stroke._strokeColor = _strokeColor;
if (adjustForResolution)
texDef._stroke._strokeSize = _strokeSize * CC_CONTENT_SCALE_FACTOR();
else
texDef._stroke._strokeSize = _strokeSize;
}
_renderLabel->setScaleX(-1.0f);
}
else
{
texDef._stroke._strokeEnabled = false;
_renderLabel->setScaleX(1.0f);
}
// shadow
if ( _shadowEnabled )
}
void LabelTTF::setFlippedY(bool flippedY)
{
if (flippedY)
{
texDef._shadow._shadowEnabled = true;
texDef._shadow._shadowBlur = _shadowBlur;
texDef._shadow._shadowOpacity = _shadowOpacity;
if (adjustForResolution)
texDef._shadow._shadowOffset = CC_SIZE_POINTS_TO_PIXELS(_shadowOffset);
else
texDef._shadow._shadowOffset = _shadowOffset;
}
_renderLabel->setScaleY(-1.0f);
}
else
{
texDef._shadow._shadowEnabled = false;
_renderLabel->setScaleY(1.0f);
}
// text tint
texDef._fontFillColor = _textFillColor;
return texDef;
}
void LabelTTF::visit(Renderer *renderer, const kmMat4 &parentTransform, bool parentTransformUpdated)
{
if (_contentDirty)
{
this->setContentSize(_renderLabel->getContentSize());
_contentDirty = false;
}
Node::visit(renderer,parentTransform,parentTransformUpdated);
}
const Size& LabelTTF::getContentSize() const
{
const_cast<LabelTTF*>(this)->setContentSize(_renderLabel->getContentSize());
return _contentSize;
}
NS_CC_END

View File

@ -26,11 +26,12 @@ THE SOFTWARE.
#ifndef __CCLABELTTF_H__
#define __CCLABELTTF_H__
#include "CCTexture2D.h"
#include "CCSprite.h"
#include "CCNode.h"
NS_CC_BEGIN
class Label;
/**
* @addtogroup GUI
* @{
@ -55,7 +56,7 @@ NS_CC_BEGIN
* @endcode
*
*/
class CC_DLL LabelTTF : public Sprite, public LabelProtocol
class CC_DLL LabelTTF : public Node, public LabelProtocol, public BlendProtocol
{
public:
/**
@ -68,39 +69,21 @@ public:
*/
virtual ~LabelTTF();
/** creates a LabelTTF with a font name and font size in points
@since v2.0.1
*/
static LabelTTF * create(const std::string& string, const std::string& fontName, float fontSize);
/** creates a LabelTTF from a fontname, horizontal alignment, dimension in points, and font size in points.
@since v2.0.1
*/
static LabelTTF * create(const std::string& string, const std::string& fontName, float fontSize,
const Size& dimensions, TextHAlignment hAlignment);
/** creates a Label from a fontname, alignment, dimension in points and font size in points
@since v2.0.1
*/
static LabelTTF * create(const std::string& string, const std::string& fontName, float fontSize,
const Size& dimensions, TextHAlignment hAlignment,
TextVAlignment vAlignment);
const Size& dimensions = Size::ZERO, TextHAlignment hAlignment = TextHAlignment::CENTER,
TextVAlignment vAlignment = TextVAlignment::TOP);
/** Create a lable with string and a font definition*/
static LabelTTF * createWithFontDefinition(const std::string& string, FontDefinition &textDefinition);
/** initializes the LabelTTF with a font name and font size */
bool initWithString(const std::string& string, const std::string& fontName, float fontSize);
/** initializes the LabelTTF with a font name, alignment, dimension and font size */
bool initWithString(const std::string& string, const std::string& fontName, float fontSize,
const Size& dimensions, TextHAlignment hAlignment);
/** initializes the LabelTTF with a font name, alignment, dimension and font size */
bool initWithString(const std::string& string, const std::string& fontName, float fontSize,
const Size& dimensions, TextHAlignment hAlignment,
TextVAlignment vAlignment);
const Size& dimensions = Size::ZERO, TextHAlignment hAlignment = TextHAlignment::LEFT,
TextVAlignment vAlignment = TextVAlignment::TOP);
/** initializes the LabelTTF with a font name, alignment, dimension and font size */
bool initWithStringAndTextDefinition(const std::string& string, FontDefinition &textDefinition);
@ -109,7 +92,7 @@ public:
void setTextDefinition(const FontDefinition& theDefinition);
/** get the text definition used by this label */
FontDefinition getTextDefinition();
const FontDefinition& getTextDefinition() const;
@ -128,11 +111,6 @@ public:
/** set text tinting */
void setFontFillColor(const Color3B &tintColor, bool mustUpdateTexture = true);
/** initializes the LabelTTF */
bool init();
/** Creates an label.
*/
static LabelTTF * create();
@ -141,7 +119,7 @@ public:
* @warning Changing the string is as expensive as creating a new LabelTTF. To obtain better performance use LabelAtlas
*/
virtual void setString(const std::string &label) override;
virtual const std::string& getString(void) const override;
virtual const std::string& getString(void) const override ;
TextHAlignment getHorizontalAlignment() const;
void setHorizontalAlignment(TextHAlignment alignment);
@ -158,46 +136,23 @@ public:
const std::string& getFontName() const;
void setFontName(const std::string& fontName);
virtual void setBlendFunc(const BlendFunc &blendFunc) override;
virtual const BlendFunc &getBlendFunc() const override;
virtual void setFlippedX(bool flippedX);
virtual void setFlippedY(bool flippedY);
/**
* @js NA
* @lua NA
*/
virtual std::string getDescription() const override;
virtual void visit(Renderer *renderer, const kmMat4 &parentTransform, bool parentTransformUpdated) override;
virtual const Size& getContentSize() const override;
protected:
bool updateTexture();
/** set the text definition for this label */
void _updateWithTextDefinition(const FontDefinition& textDefinition, bool mustUpdateTexture = true);
FontDefinition _prepareTextDefinition(bool adjustForResolution = false);
/** Dimensions of the label in Points */
Size _dimensions;
/** The alignment of the label */
TextHAlignment _alignment;
/** The vertical alignment of the label */
TextVAlignment _vAlignment;
/** Font name used in the label */
std::string _fontName;
/** Font size of the label */
float _fontSize;
/** label's string */
std::string _string;
/** font shadow */
bool _shadowEnabled;
Size _shadowOffset;
float _shadowOpacity;
float _shadowBlur;
/** font stroke */
bool _strokeEnabled;
Color3B _strokeColor;
float _strokeSize;
/** font tint */
Color3B _textFillColor;
Label* _renderLabel;
bool _contentDirty;
};

View File

@ -413,34 +413,30 @@ void RenderTexture::visit(Renderer *renderer, const kmMat4 &parentTransform, boo
bool RenderTexture::saveToFile(const std::string& filename)
{
bool ret = false;
Image *image = newImage(true);
if (image)
{
ret = image->saveToFile(filename);
}
CC_SAFE_DELETE(image);
return ret;
return saveToFile(filename,Image::Format::JPG);
}
bool RenderTexture::saveToFile(const std::string& fileName, Image::Format format)
{
bool ret = false;
CCASSERT(format == Image::Format::JPG || format == Image::Format::PNG,
"the image can only be saved as JPG or PNG format");
std::string fullpath = FileUtils::getInstance()->getWritablePath() + fileName;
_saveToFileCommand.init(_globalZOrder);
_saveToFileCommand.func = CC_CALLBACK_0(RenderTexture::onSaveToFile,this,fullpath);
Director::getInstance()->getRenderer()->addCommand(&_saveToFileCommand);
return true;
}
void RenderTexture::onSaveToFile(const std::string& filename)
{
Image *image = newImage(true);
if (image)
{
std::string fullpath = FileUtils::getInstance()->getWritablePath() + fileName;
ret = image->saveToFile(fullpath.c_str(), true);
image->saveToFile(filename.c_str(), true);
}
CC_SAFE_DELETE(image);
return ret;
}
/* get buffer as Image */

View File

@ -214,6 +214,7 @@ protected:
CustomCommand _clearCommand;
CustomCommand _beginCommand;
CustomCommand _endCommand;
CustomCommand _saveToFileCommand;
protected:
//renderer caches and callbacks
void onBegin();
@ -221,6 +222,8 @@ protected:
void onClear();
void onClearDepth();
void onSaveToFile(const std::string& fileName);
kmMat4 _oldTransMatrix, _oldProjMatrix;
kmMat4 _transformMatrix, _projectionMatrix;

View File

@ -1083,7 +1083,12 @@ bool Texture2D::initWithString(const char *text, const FontDefinition& textDefin
int imageWidth;
int imageHeight;
Data outData = Device::getTextureDataForText(text,textDefinition,align,imageWidth,imageHeight);
auto textDef = textDefinition;
auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR();
textDef._fontSize *= contentScaleFactor;
textDef._dimensions.width *= contentScaleFactor;
textDef._dimensions.height *= contentScaleFactor;
Data outData = Device::getTextureDataForText(text,textDef,align,imageWidth,imageHeight);
if(outData.isNull())
return false;

View File

@ -121,13 +121,13 @@ float tweenTo(float time, TweenType type, float *easingParam)
break;
case Elastic_EaseIn:
delta = elasticEaseIn(time, easingParam);
delta = elasticEaseIn(time, easingParam[0]);
break;
case Elastic_EaseOut:
delta = elasticEaseOut(time, easingParam);
delta = elasticEaseOut(time, easingParam[0]);
break;
case Elastic_EaseInOut:
delta = elasticEaseInOut(time, easingParam);
delta = elasticEaseInOut(time, easingParam[0]);
break;
@ -315,14 +315,8 @@ float circEaseInOut(float time)
// Elastic Ease
float elasticEaseIn(float time, float *easingParam)
float elasticEaseIn(float time, float period)
{
float period = 0.3f;
if (easingParam != NULL)
{
period = easingParam[0];
}
float newT = 0;
if (time == 0 || time == 1)
@ -338,14 +332,8 @@ float elasticEaseIn(float time, float *easingParam)
return newT;
}
float elasticEaseOut(float time, float *easingParam)
float elasticEaseOut(float time, float period)
{
float period = 0.3f;
if (easingParam != NULL)
{
period = easingParam[0];
}
float newT = 0;
if (time == 0 || time == 1)
@ -360,14 +348,8 @@ float elasticEaseOut(float time, float *easingParam)
return newT;
}
float elasticEaseInOut(float time, float *easingParam)
float elasticEaseInOut(float time, float period)
{
float period = 0.3f;
if (easingParam != NULL)
{
period = easingParam[0];
}
float newT = 0;
if (time == 0 || time == 1)

View File

@ -128,9 +128,9 @@ namespace tweenfunc {
float circEaseOut(float time);
float circEaseInOut(float time);
float elasticEaseIn(float time, float *easingParam);
float elasticEaseOut(float time, float *easingParam);
float elasticEaseInOut(float time, float *easingParam);
float elasticEaseIn(float time, float period);
float elasticEaseOut(float time, float period);
float elasticEaseInOut(float time, float period);
float backEaseIn(float time);
float backEaseOut(float time);

View File

@ -58,8 +58,6 @@ enum class ResolutionPolicy
NS_CC_BEGIN
class EGLTouchDelegate;
/**
* @addtogroup platform
* @{

View File

@ -35,7 +35,7 @@ THE SOFTWARE.
NS_CC_BEGIN
class CC_DLL GLView : public Ref, public GLViewProtocol
class CC_DLL GLView : public GLViewProtocol, public Ref
{
public:

View File

@ -33,7 +33,7 @@ THE SOFTWARE.
NS_CC_BEGIN
class CC_DLL GLView : public Ref, public GLViewProtocol
class CC_DLL GLView : public GLViewProtocol, public Ref
{
public:
static GLView* create(const std::string& viewName);

View File

@ -38,7 +38,7 @@ NS_CC_BEGIN
/** Class that represent the OpenGL View
*/
class CC_DLL GLView : public Ref, public GLViewProtocol
class CC_DLL GLView : public GLViewProtocol, public Ref
{
public:
/** creates a GLView with a objective-c CCEAGLView instance */

View File

@ -68,11 +68,11 @@ LOCAL_EXPORT_CFLAGS += -Wno-psabi
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_gui_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_ui_static
include $(BUILD_STATIC_LIBRARY)
$(call import-module,2d)
$(call import-module,audio/android)
$(call import-module,gui)
$(call import-module,ui)

View File

@ -25,8 +25,8 @@ THE SOFTWARE.
#include "cocostudio/CCActionNode.h"
#include "cocostudio/CCActionFrameEasing.h"
#include "cocostudio/DictionaryHelper.h"
#include "gui/UIWidget.h"
#include "gui/UIHelper.h"
#include "ui/UIWidget.h"
#include "ui/UIHelper.h"
using namespace cocos2d;
using namespace ui;

View File

@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "cocostudio/CCSGUIReader.h"
#include "gui/CocosGUI.h"
#include "ui/CocosGUI.h"
#include "cocostudio/CCActionManagerEx.h"
#include <fstream>
#include <iostream>

View File

@ -25,7 +25,7 @@ THE SOFTWARE.
#ifndef __CCSGUIREADER_H__
#define __CCSGUIREADER_H__
#include "gui/UIWidget.h"
#include "ui/UIWidget.h"
#include "cocostudio/DictionaryHelper.h"
#include "WidgetReader/WidgetReaderProtocol.h"
#include "ObjectFactory.h"

View File

@ -23,7 +23,7 @@ THE SOFTWARE.
****************************************************************************/
#include "cocostudio/CocoStudio.h"
#include "gui/CocosGUI.h"
#include "ui/CocosGUI.h"
#include "SimpleAudioEngine.h"
#include "ObjectFactory.h"

View File

@ -23,7 +23,7 @@ THE SOFTWARE.
****************************************************************************/
#include "ObjectFactory.h"
#include "gui/UIWidget.h"
#include "ui/UIWidget.h"
#include "cocostudio/WidgetReader/WidgetReaderProtocol.h"
using namespace cocos2d;
@ -199,4 +199,4 @@ void ObjectFactory::registerType(const TInfo &t)
_typeMap.insert(std::make_pair(t._class, t));
}
}
}

View File

@ -36,7 +36,7 @@ TriggerMng* TriggerMng::_sharedTriggerMng = nullptr;
TriggerMng::TriggerMng(void)
: _movementDispatches(new std::unordered_map<Armature*, ArmatureMovementDispatcher*>)
{
_eventDispatcher = CCDirector::getInstance()->getEventDispatcher();
_eventDispatcher = Director::getInstance()->getEventDispatcher();
_eventDispatcher->retain();
}

View File

@ -115,11 +115,11 @@ bool TriggerObj::detect()
return true;
}
bool ret = true;
bool ret = false;
for (const auto& con : _cons)
{
ret = ret && con->detect();
ret = ret || con->detect();
}
return ret;
@ -220,14 +220,14 @@ void TriggerObj::serialize(const rapidjson::Value &val)
std::string custom_event_name(buf);
CC_SAFE_DELETE_ARRAY(buf);
EventListenerCustom *_listener = EventListenerCustom::create(custom_event_name, [=](EventCustom* event){
EventListenerCustom* listener = EventListenerCustom::create(custom_event_name, [=](EventCustom* evt){
if (detect())
{
done();
}
});
_listeners.pushBack(_listener);
TriggerMng::getInstance()->addEventListenerWithFixedPriority(_listener, 1);
_listeners.pushBack(listener);
TriggerMng::getInstance()->addEventListenerWithFixedPriority(listener, 1);
}
}

View File

@ -1,7 +1,7 @@
#include "ButtonReader.h"
#include "gui/UIButton.h"
#include "ui/UIButton.h"
USING_NS_CC;
using namespace ui;

View File

@ -1,7 +1,7 @@
#include "CheckBoxReader.h"
#include "gui/UICheckBox.h"
#include "ui/UICheckBox.h"
USING_NS_CC;
using namespace ui;

View File

@ -1,7 +1,7 @@
#include "ImageViewReader.h"
#include "gui/UIImageView.h"
#include "ui/UIImageView.h"
USING_NS_CC;
using namespace ui;

View File

@ -1,7 +1,7 @@
#include "LayoutReader.h"
#include "gui/UILayout.h"
#include "ui/UILayout.h"
USING_NS_CC;
using namespace ui;

View File

@ -1,7 +1,7 @@
#include "ListViewReader.h"
#include "gui/UIListView.h"
#include "ui/UIListView.h"
USING_NS_CC;
using namespace ui;

View File

@ -1,7 +1,7 @@
#include "LoadingBarReader.h"
#include "gui/UILoadingBar.h"
#include "ui/UILoadingBar.h"
USING_NS_CC;
using namespace ui;

View File

@ -1,7 +1,7 @@
#include "PageViewReader.h"
#include "gui/UIPageView.h"
#include "ui/UIPageView.h"
USING_NS_CC;
using namespace ui;

View File

@ -1,7 +1,7 @@
#include "ScrollViewReader.h"
#include "gui/UIScrollView.h"
#include "ui/UIScrollView.h"
USING_NS_CC;
using namespace ui;

View File

@ -1,7 +1,7 @@
#include "SliderReader.h"
#include "gui/UISlider.h"
#include "ui/UISlider.h"
USING_NS_CC;
using namespace ui;

View File

@ -1,7 +1,7 @@
#include "TextAtlasReader.h"
#include "gui/UITextAtlas.h"
#include "ui/UITextAtlas.h"
USING_NS_CC;
using namespace ui;

View File

@ -1,7 +1,7 @@
#include "TextBMFontReader.h"
#include "gui/UITextBMFont.h"
#include "ui/UITextBMFont.h"
USING_NS_CC;
using namespace ui;

View File

@ -1,7 +1,7 @@
#include "TextFieldReader.h"
#include "gui/UITextField.h"
#include "ui/UITextField.h"
USING_NS_CC;
using namespace ui;

View File

@ -1,7 +1,7 @@
#include "TextReader.h"
#include "gui/UIText.h"
#include "ui/UIText.h"
USING_NS_CC;
using namespace ui;

View File

@ -27,8 +27,8 @@
#include "WidgetReaderProtocol.h"
#include "../CCSGUIReader.h"
#include "gui/GUIDefine.h"
#include "gui/UIWidget.h"
#include "ui/GUIDefine.h"
#include "ui/UIWidget.h"
namespace cocostudio
{

View File

@ -20,7 +20,7 @@ LOCAL_SRC_FILES := manual/CCLuaBridge.cpp \
manual/lua_cocos2dx_manual.cpp \
manual/lua_cocos2dx_extension_manual.cpp \
manual/lua_cocos2dx_coco_studio_manual.cpp \
manual/lua_cocos2dx_gui_manual.cpp \
manual/lua_cocos2dx_ui_manual.cpp \
manual/lua_cocos2dx_spine_manual.cpp \
manual/lua_cocos2dx_physics_manual.cpp \
manual/lua_cocos2dx_deprecated.cpp \
@ -32,7 +32,7 @@ LOCAL_SRC_FILES := manual/CCLuaBridge.cpp \
auto/lua_cocos2dx_auto.cpp \
auto/lua_cocos2dx_extension_auto.cpp \
auto/lua_cocos2dx_studio_auto.cpp \
auto/lua_cocos2dx_gui_auto.cpp \
auto/lua_cocos2dx_ui_auto.cpp \
auto/lua_cocos2dx_spine_auto.cpp \
auto/lua_cocos2dx_physics_auto.cpp \
../../../external/lua/tolua/tolua_event.c \
@ -65,7 +65,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../external/lua/tolua \
$(LOCAL_PATH)/../../editor-support/spine \
$(LOCAL_PATH)/../../editor-support/cocosbuilder \
$(LOCAL_PATH)/../../editor-support/cocostudio \
$(LOCAL_PATH)/../../gui \
$(LOCAL_PATH)/../../ui \
$(LOCAL_PATH)/auto \
$(LOCAL_PATH)/manual \
$(LOCAL_PATH)/manual/platform/android \

View File

@ -2,7 +2,7 @@ set(LUABINDING_SRC
auto/lua_cocos2dx_auto.cpp
auto/lua_cocos2dx_extension_auto.cpp
auto/lua_cocos2dx_studio_auto.cpp
auto/lua_cocos2dx_gui_auto.cpp
auto/lua_cocos2dx_ui_auto.cpp
auto/lua_cocos2dx_spine_auto.cpp
auto/lua_cocos2dx_physics_auto.cpp
manual/tolua_fix.cpp
@ -18,7 +18,7 @@ set(LUABINDING_SRC
manual/lua_cocos2dx_manual.cpp
manual/lua_cocos2dx_extension_manual.cpp
manual/lua_cocos2dx_coco_studio_manual.cpp
manual/lua_cocos2dx_gui_manual.cpp
manual/lua_cocos2dx_ui_manual.cpp
manual/lua_cocos2dx_spine_manual.cpp
manual/lua_cocos2dx_physics_manual.cpp
manual/lua_cocos2dx_deprecated.cpp
@ -32,7 +32,7 @@ include_directories(
../../editor-support/cocosbuilder
../../editor-support/cocostudio
../../editor-support/spine
../../gui
../../ui
../../../external/lua/lua
../../../external/lua/tolua
)

View File

@ -1,16 +1,6 @@
--------------------------------
-- @module GLView
--------------------------------
-- @function [parent=#GLView] setIMEKeyboardState
-- @param self
-- @param #bool bool
--------------------------------
-- @function [parent=#GLView] isOpenGLReady
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
-- @function [parent=#GLView] createWithRect
-- @param self

View File

@ -11,6 +11,11 @@
-- @param #unsigned int int
-- @param #unsigned int int
--------------------------------
-- @function [parent=#Label] getFontSize
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
-- @function [parent=#Label] getString
-- @param self
@ -35,6 +40,11 @@
-- @param self
-- @param #unsigned int int
--------------------------------
-- @function [parent=#Label] setFontName
-- @param self
-- @param #string str
--------------------------------
-- @function [parent=#Label] getMaxLineWidth
-- @param self
@ -62,6 +72,20 @@
-- @param #point_table point
-- @return bool#bool ret (return value: bool)
--------------------------------
-- @function [parent=#Label] getFontDefinition
-- @param self
-- @return FontDefinition#FontDefinition ret (return value: cc.FontDefinition)
--------------------------------
-- @function [parent=#Label] getFontName
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
-- @function [parent=#Label] updateContent
-- @param self
--------------------------------
-- @function [parent=#Label] getStringLength
-- @param self
@ -98,6 +122,11 @@
-- @param #int int
-- @return bool#bool ret (retunr value: bool)
--------------------------------
-- @function [parent=#Label] getDimensions
-- @param self
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
-- @function [parent=#Label] setMaxLineWidth
-- @param self
@ -107,7 +136,11 @@
-- @function [parent=#Label] setVerticalAlignment
-- @param self
-- @param #cc.TextVAlignment textvalignment
-- @param #bool bool
--------------------------------
-- @function [parent=#Label] setFontSize
-- @param self
-- @param #int int
--------------------------------
-- @function [parent=#Label] getVerticalAlignment
@ -139,18 +172,21 @@
-- @function [parent=#Label] setHorizontalAlignment
-- @param self
-- @param #cc.TextHAlignment texthalignment
-- @param #bool bool
--------------------------------
-- overload function: setAlignment(cc.TextHAlignment, cc.TextVAlignment, bool)
-- @function [parent=#Label] setFontDefinition
-- @param self
-- @param #cc.FontDefinition fontdefinition
--------------------------------
-- overload function: setAlignment(cc.TextHAlignment, cc.TextVAlignment)
--
-- overload function: setAlignment(cc.TextHAlignment, bool)
-- overload function: setAlignment(cc.TextHAlignment)
--
-- @function [parent=#Label] setAlignment
-- @param self
-- @param #cc.TextHAlignment texthalignment
-- @param #cc.TextVAlignment textvalignment
-- @param #bool bool
--------------------------------
-- @function [parent=#Label] createWithBMFont
@ -163,10 +199,20 @@
-- @return Label#Label ret (return value: cc.Label)
--------------------------------
-- @function [parent=#Label] create
-- overload function: create(string, string, float, size_table, cc.TextHAlignment, cc.TextVAlignment)
--
-- overload function: create()
--
-- @function [parent=#Label] create
-- @param self
-- @return Label#Label ret (return value: cc.Label)
-- @param #string str
-- @param #string str
-- @param #float float
-- @param #size_table size
-- @param #cc.TextHAlignment texthalignment
-- @param #cc.TextVAlignment textvalignment
-- @return Label#Label ret (retunr value: cc.Label)
--------------------------------
-- overload function: createWithCharMap(cc.Texture2D, int, int, int)
--
@ -182,4 +228,11 @@
-- @param #int int
-- @return Label#Label ret (retunr value: cc.Label)
--------------------------------
-- @function [parent=#Label] createWithFontDefinition
-- @param self
-- @param #string str
-- @param #cc.FontDefinition fontdefinition
-- @return Label#Label ret (return value: cc.Label)
return nil

View File

@ -24,6 +24,16 @@
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
-- @function [parent=#LabelTTF] setFlippedY
-- @param self
-- @param #bool bool
--------------------------------
-- @function [parent=#LabelTTF] setFlippedX
-- @param self
-- @param #bool bool
--------------------------------
-- @function [parent=#LabelTTF] setTextDefinition
-- @param self
@ -52,13 +62,7 @@
-- @param #string str
--------------------------------
-- overload function: initWithString(string, string, float, size_table, cc.TextHAlignment)
--
-- overload function: initWithString(string, string, float)
--
-- overload function: initWithString(string, string, float, size_table, cc.TextHAlignment, cc.TextVAlignment)
--
-- @function [parent=#LabelTTF] initWithString
-- @function [parent=#LabelTTF] initWithString
-- @param self
-- @param #string str
-- @param #string str
@ -66,11 +70,6 @@
-- @param #size_table size
-- @param #cc.TextHAlignment texthalignment
-- @param #cc.TextVAlignment textvalignment
-- @return bool#bool ret (retunr value: bool)
--------------------------------
-- @function [parent=#LabelTTF] init
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
@ -79,6 +78,11 @@
-- @param #color3B_table color3b
-- @param #bool bool
--------------------------------
-- @function [parent=#LabelTTF] getBlendFunc
-- @param self
-- @return BlendFunc#BlendFunc ret (return value: cc.BlendFunc)
--------------------------------
-- @function [parent=#LabelTTF] enableStroke
-- @param self
@ -111,6 +115,11 @@
-- @param self
-- @return FontDefinition#FontDefinition ret (return value: cc.FontDefinition)
--------------------------------
-- @function [parent=#LabelTTF] setBlendFunc
-- @param self
-- @param #cc.BlendFunc blendfunc
--------------------------------
-- @function [parent=#LabelTTF] getFontName
-- @param self
@ -130,14 +139,10 @@
-- @param self
--------------------------------
-- overload function: create(string, string, float, size_table, cc.TextHAlignment)
--
-- overload function: create(string, string, float)
-- overload function: create()
--
-- overload function: create(string, string, float, size_table, cc.TextHAlignment, cc.TextVAlignment)
--
-- overload function: create()
--
-- @function [parent=#LabelTTF] create
-- @param self
-- @param #string str

View File

@ -671,11 +671,6 @@
-- @field [parent=#cc] TiledGrid3D#TiledGrid3D TiledGrid3D preloaded module
--------------------------------------------------------
-- the cc Sprite
-- @field [parent=#cc] Sprite#Sprite Sprite preloaded module
--------------------------------------------------------
-- the cc LabelTTF
-- @field [parent=#cc] LabelTTF#LabelTTF LabelTTF preloaded module
@ -956,6 +951,11 @@
-- @field [parent=#cc] MotionStreak#MotionStreak MotionStreak preloaded module
--------------------------------------------------------
-- the cc Sprite
-- @field [parent=#cc] Sprite#Sprite Sprite preloaded module
--------------------------------------------------------
-- the cc ProgressTimer
-- @field [parent=#cc] ProgressTimer#ProgressTimer ProgressTimer preloaded module

View File

@ -1,6 +1,16 @@
--------------------------------
-- @module cc
--------------------------------------------------------
-- the cc PhysicsWorld
-- @field [parent=#cc] PhysicsWorld#PhysicsWorld PhysicsWorld preloaded module
--------------------------------------------------------
-- the cc PhysicsDebugDraw
-- @field [parent=#cc] PhysicsDebugDraw#PhysicsDebugDraw PhysicsDebugDraw preloaded module
--------------------------------------------------------
-- the cc PhysicsShape
-- @field [parent=#cc] PhysicsShape#PhysicsShape PhysicsShape preloaded module
@ -46,16 +56,6 @@
-- @field [parent=#cc] PhysicsBody#PhysicsBody PhysicsBody preloaded module
--------------------------------------------------------
-- the cc PhysicsWorld
-- @field [parent=#cc] PhysicsWorld#PhysicsWorld PhysicsWorld preloaded module
--------------------------------------------------------
-- the cc PhysicsDebugDraw
-- @field [parent=#cc] PhysicsDebugDraw#PhysicsDebugDraw PhysicsDebugDraw preloaded module
--------------------------------------------------------
-- the cc PhysicsContact
-- @field [parent=#cc] PhysicsContact#PhysicsContact PhysicsContact preloaded module

View File

@ -1 +1 @@
0a7af9a7041d3864365f2f28e3ad16c35c24f34b
c0580e239bc0d30c6d09103a806ab3e6e76da123

View File

@ -1528,6 +1528,16 @@ int register_all_cocos2dx(lua_State* tolua_S);

View File

@ -1 +0,0 @@
8a35e56a7f283d9816a34997ab75c41201e1c1da

View File

@ -1 +1 @@
9ee0235aac42ea657853d56947716b3fc8fee2c2
6deb0e9e9ec193559f4eaa0f48310265bc32a491

View File

@ -0,0 +1 @@
c9cf8f3050b95aec88a2452e60fe492252ad30c3

View File

@ -121,7 +121,7 @@ const char* CCBProxy::getNodeTypeName(Node* pNode)
return "cc.Layer";
}
if (NULL != dynamic_cast<String*>(pNode)) {
if (NULL != dynamic_cast<__String*>(pNode)) {
return "cc.String";
}

View File

@ -33,7 +33,7 @@
#include "lua_cocos2dx_manual.hpp"
#include "lua_cocos2dx_extension_manual.h"
#include "lua_cocos2dx_coco_studio_manual.hpp"
#include "lua_cocos2dx_gui_manual.hpp"
#include "lua_cocos2dx_ui_manual.hpp"
NS_CC_BEGIN
@ -117,7 +117,7 @@ int LuaEngine::executeMenuItemEvent(MenuItem* pMenuItem)
return 0;
}
int LuaEngine::executeNotificationEvent(NotificationCenter* pNotificationCenter, const char* pszName)
int LuaEngine::executeNotificationEvent(__NotificationCenter* pNotificationCenter, const char* pszName)
{
int nHandler = pNotificationCenter->getObserverHandlerByName(pszName);
if (!nHandler) return 0;
@ -147,7 +147,7 @@ int LuaEngine::executeLayerTouchEvent(Layer* pLayer, int eventType, Touch *pTouc
return 0;
}
int LuaEngine::executeLayerTouchesEvent(Layer* pLayer, int eventType, Set *pTouches)
int LuaEngine::executeLayerTouchesEvent(Layer* pLayer, int eventType, __Set *pTouches)
{
return 0;
}

View File

@ -113,10 +113,10 @@ public:
virtual int executeNodeEvent(Node* pNode, int nAction);
virtual int executeMenuItemEvent(MenuItem* pMenuItem);
virtual int executeNotificationEvent(NotificationCenter* pNotificationCenter, const char* pszName);
virtual int executeNotificationEvent(__NotificationCenter* pNotificationCenter, const char* pszName);
virtual int executeCallFuncActionEvent(CallFunc* pAction, Ref* pTarget = NULL);
virtual int executeSchedule(int nHandler, float dt, Node* pNode = NULL);
virtual int executeLayerTouchesEvent(Layer* pLayer, int eventType, Set *pTouches);
virtual int executeLayerTouchesEvent(Layer* pLayer, int eventType, __Set *pTouches);
virtual int executeLayerTouchEvent(Layer* pLayer, int eventType, Touch *pTouch);
virtual int executeLayerKeypadEvent(Layer* pLayer, int eventType);
/** execute a accelerometer event */

View File

@ -63,8 +63,8 @@ extern "C" {
#include "lua_cocos2dx_spine_manual.hpp"
#include "lua_cocos2dx_physics_auto.hpp"
#include "lua_cocos2dx_physics_manual.hpp"
#include "lua_cocos2dx_gui_auto.hpp"
#include "lua_cocos2dx_gui_manual.hpp"
#include "lua_cocos2dx_ui_auto.hpp"
#include "lua_cocos2dx_ui_manual.hpp"
namespace {
int lua_print(lua_State * luastate)
@ -507,7 +507,7 @@ int LuaStack::reallocateScriptHandler(int nHandler)
}
int LuaStack::executeFunctionReturnArray(int handler,int numArgs,int numResults,Array& resultArray)
int LuaStack::executeFunctionReturnArray(int handler,int numArgs,int numResults,__Array& resultArray)
{
if (pushFunctionByHandler(handler)) /* L: ... arg1 arg2 ... func */
{

View File

@ -124,7 +124,7 @@ public:
virtual int executeFunction(int numArgs);
virtual int executeFunctionByHandler(int nHandler, int numArgs);
virtual int executeFunctionReturnArray(int handler,int numArgs,int numResults,Array& resultArray);
virtual int executeFunctionReturnArray(int handler,int numArgs,int numResults,__Array& resultArray);
virtual int executeFunction(int handler, int numArgs, int numResults, const std::function<void(lua_State*,int)>& func);
virtual bool handleAssert(const char *msg);

View File

@ -25,6 +25,8 @@
#include "LuaBasicConversions.h"
#include "tolua_fix.h"
std::unordered_map<std::string, std::string> g_luaType;
std::unordered_map<std::string, std::string> g_typeCast;
@ -778,7 +780,7 @@ bool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outValue )
return ok;
}
bool luaval_to_array(lua_State* L,int lo, Array** outValue)
bool luaval_to_array(lua_State* L,int lo, __Array** outValue)
{
if (NULL == L || NULL == outValue)
return false;
@ -799,7 +801,7 @@ bool luaval_to_array(lua_State* L,int lo, Array** outValue)
size_t len = lua_objlen(L, lo);
if (len > 0)
{
Array* arr = Array::createWithCapacity(len);
__Array* arr = __Array::createWithCapacity(len);
if (NULL == arr)
return false;
@ -828,7 +830,7 @@ bool luaval_to_array(lua_State* L,int lo, Array** outValue)
if (lua_isnil(L, -1) )
{
lua_pop(L,1);
Dictionary* dictVal = NULL;
__Dictionary* dictVal = NULL;
if (luaval_to_dictionary(L,-1,&dictVal))
{
arr->addObject(dictVal);
@ -837,7 +839,7 @@ bool luaval_to_array(lua_State* L,int lo, Array** outValue)
else
{
lua_pop(L,1);
Array* arrVal = NULL;
__Array* arrVal = NULL;
if(luaval_to_array(L, -1, &arrVal))
{
arr->addObject(arrVal);
@ -878,7 +880,7 @@ bool luaval_to_array(lua_State* L,int lo, Array** outValue)
return ok;
}
bool luaval_to_dictionary(lua_State* L,int lo, Dictionary** outValue)
bool luaval_to_dictionary(lua_State* L,int lo, __Dictionary** outValue)
{
if (NULL == L || NULL == outValue)
return false;
@ -899,7 +901,7 @@ bool luaval_to_dictionary(lua_State* L,int lo, Dictionary** outValue)
std::string stringKey = "";
std::string stringValue = "";
bool boolVal = false;
Dictionary* dict = NULL;
__Dictionary* dict = NULL;
lua_pushnil(L); /* L: lotable ..... nil */
while ( 0 != lua_next(L, lo ) ) /* L: lotable ..... key value */
{
@ -932,7 +934,7 @@ bool luaval_to_dictionary(lua_State* L,int lo, Dictionary** outValue)
if (lua_isnil(L, -1) )
{
lua_pop(L,1);
Dictionary* dictVal = NULL;
__Dictionary* dictVal = NULL;
if (luaval_to_dictionary(L,-1,&dictVal))
{
dict->setObject(dictVal,stringKey);
@ -941,7 +943,7 @@ bool luaval_to_dictionary(lua_State* L,int lo, Dictionary** outValue)
else
{
lua_pop(L,1);
Array* arrVal = NULL;
__Array* arrVal = NULL;
if(luaval_to_array(L, -1, &arrVal))
{
dict->setObject(arrVal,stringKey);
@ -976,6 +978,7 @@ bool luaval_to_dictionary(lua_State* L,int lo, Dictionary** outValue)
}
/* L: lotable ..... */
*outValue = dict;
}
return ok;
@ -1037,14 +1040,14 @@ bool luaval_to_array_of_Point(lua_State* L,int lo,Point **points, int *numPoints
}
bool luavals_variadic_to_array(lua_State* L,int argc, Array** ret)
bool luavals_variadic_to_array(lua_State* L,int argc, __Array** ret)
{
if (nullptr == L || argc == 0 )
return false;
bool ok = true;
Array* array = Array::create();
__Array* array = __Array::create();
for (int i = 0; i < argc; i++)
{
double num = 0.0;
@ -1804,7 +1807,7 @@ void fontdefinition_to_luaval(lua_State* L,const FontDefinition& inValue)
lua_rawset(L, -3); /* table[key] = value, L: table */
}
void array_to_luaval(lua_State* L,Array* inValue)
void array_to_luaval(lua_State* L,__Array* inValue)
{
lua_newtable(L);
@ -1814,13 +1817,13 @@ void array_to_luaval(lua_State* L,Array* inValue)
Ref* obj = nullptr;
std::string className = "";
String* strVal = nullptr;
Dictionary* dictVal = nullptr;
Array* arrVal = nullptr;
Double* doubleVal = nullptr;
Bool* boolVal = nullptr;
Float* floatVal = nullptr;
Integer* intVal = nullptr;
__String* strVal = nullptr;
__Dictionary* dictVal = nullptr;
__Array* arrVal = nullptr;
__Double* doubleVal = nullptr;
__Bool* boolVal = nullptr;
__Float* floatVal = nullptr;
__Integer* intVal = nullptr;
int indexTable = 1;
CCARRAY_FOREACH(inValue, obj)
@ -1844,43 +1847,43 @@ void array_to_luaval(lua_State* L,Array* inValue)
++indexTable;
}
}
else if((strVal = dynamic_cast<cocos2d::String *>(obj)))
else if((strVal = dynamic_cast<__String *>(obj)))
{
lua_pushnumber(L, (lua_Number)indexTable);
lua_pushstring(L, strVal->getCString());
lua_rawset(L, -3);
++indexTable;
}
else if ((dictVal = dynamic_cast<cocos2d::Dictionary*>(obj)))
else if ((dictVal = dynamic_cast<__Dictionary*>(obj)))
{
dictionary_to_luaval(L, dictVal);
}
else if ((arrVal = dynamic_cast<cocos2d::Array*>(obj)))
else if ((arrVal = dynamic_cast<__Array*>(obj)))
{
array_to_luaval(L, arrVal);
}
else if ((doubleVal = dynamic_cast<Double*>(obj)))
else if ((doubleVal = dynamic_cast<__Double*>(obj)))
{
lua_pushnumber(L, (lua_Number)indexTable);
lua_pushnumber(L, (lua_Number)doubleVal->getValue());
lua_rawset(L, -3);
++indexTable;
}
else if ((floatVal = dynamic_cast<Float*>(obj)))
else if ((floatVal = dynamic_cast<__Float*>(obj)))
{
lua_pushnumber(L, (lua_Number)indexTable);
lua_pushnumber(L, (lua_Number)floatVal->getValue());
lua_rawset(L, -3);
++indexTable;
}
else if ((intVal = dynamic_cast<Integer*>(obj)))
else if ((intVal = dynamic_cast<__Integer*>(obj)))
{
lua_pushnumber(L, (lua_Number)indexTable);
lua_pushinteger(L, (lua_Integer)intVal->getValue());
lua_rawset(L, -3);
++indexTable;
}
else if ((boolVal = dynamic_cast<Bool*>(obj)))
else if ((boolVal = dynamic_cast<__Bool*>(obj)))
{
lua_pushnumber(L, (lua_Number)indexTable);
lua_pushboolean(L, boolVal->getValue());
@ -1894,7 +1897,7 @@ void array_to_luaval(lua_State* L,Array* inValue)
}
}
void dictionary_to_luaval(lua_State* L, Dictionary* dict)
void dictionary_to_luaval(lua_State* L, __Dictionary* dict)
{
lua_newtable(L);
@ -1904,13 +1907,13 @@ void dictionary_to_luaval(lua_State* L, Dictionary* dict)
DictElement* element = nullptr;
std::string className = "";
String* strVal = nullptr;
Dictionary* dictVal = nullptr;
Array* arrVal = nullptr;
Double* doubleVal = nullptr;
Bool* boolVal = nullptr;
Float* floatVal = nullptr;
Integer* intVal = nullptr;
__String* strVal = nullptr;
__Dictionary* dictVal = nullptr;
__Array* arrVal = nullptr;
__Double* doubleVal = nullptr;
__Bool* boolVal = nullptr;
__Float* floatVal = nullptr;
__Integer* intVal = nullptr;
CCDICT_FOREACH(dict, element)
{
@ -1923,7 +1926,7 @@ void dictionary_to_luaval(lua_State* L, Dictionary* dict)
if (g_luaType.end() != iter)
{
className = iter->second;
if ( nullptr != dynamic_cast<cocos2d::Ref *>(element->getObject()))
if ( nullptr != dynamic_cast<Ref*>(element->getObject()))
{
lua_pushstring(L, element->getStrKey());
int ID = (element->getObject()) ? (int)element->getObject()->_ID : -1;
@ -1933,39 +1936,39 @@ void dictionary_to_luaval(lua_State* L, Dictionary* dict)
element->getObject()->retain();
}
}
else if((strVal = dynamic_cast<cocos2d::String *>(element->getObject())))
else if((strVal = dynamic_cast<__String *>(element->getObject())))
{
lua_pushstring(L, element->getStrKey());
lua_pushstring(L, strVal->getCString());
lua_rawset(L, -3);
}
else if ((dictVal = dynamic_cast<cocos2d::Dictionary*>(element->getObject())))
else if ((dictVal = dynamic_cast<__Dictionary*>(element->getObject())))
{
dictionary_to_luaval(L, dictVal);
}
else if ((arrVal = dynamic_cast<cocos2d::Array*>(element->getObject())))
else if ((arrVal = dynamic_cast<__Array*>(element->getObject())))
{
array_to_luaval(L, arrVal);
}
else if ((doubleVal = dynamic_cast<Double*>(element->getObject())))
else if ((doubleVal = dynamic_cast<__Double*>(element->getObject())))
{
lua_pushstring(L, element->getStrKey());
lua_pushnumber(L, (lua_Number)doubleVal->getValue());
lua_rawset(L, -3);
}
else if ((floatVal = dynamic_cast<Float*>(element->getObject())))
else if ((floatVal = dynamic_cast<__Float*>(element->getObject())))
{
lua_pushstring(L, element->getStrKey());
lua_pushnumber(L, (lua_Number)floatVal->getValue());
lua_rawset(L, -3);
}
else if ((intVal = dynamic_cast<Integer*>(element->getObject())))
else if ((intVal = dynamic_cast<__Integer*>(element->getObject())))
{
lua_pushstring(L, element->getStrKey());
lua_pushinteger(L, (lua_Integer)intVal->getValue());
lua_rawset(L, -3);
}
else if ((boolVal = dynamic_cast<Bool*>(element->getObject())))
else if ((boolVal = dynamic_cast<__Bool*>(element->getObject())))
{
lua_pushstring(L, element->getStrKey());
lua_pushboolean(L, boolVal->getValue());

View File

@ -67,10 +67,10 @@ extern bool luaval_to_color4f(lua_State* L,int lo,Color4F* outValue);
extern bool luaval_to_physics_material(lua_State* L,int lo, cocos2d::PhysicsMaterial* outValue);
extern bool luaval_to_affinetransform(lua_State* L,int lo, AffineTransform* outValue);
extern bool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outValue );
extern bool luaval_to_array(lua_State* L,int lo, Array** outValue);
extern bool luaval_to_dictionary(lua_State* L,int lo, Dictionary** outValue);
extern bool luaval_to_array(lua_State* L,int lo, __Array** outValue);
extern bool luaval_to_dictionary(lua_State* L,int lo, __Dictionary** outValue);
extern bool luaval_to_array_of_Point(lua_State* L,int lo,Point **points, int *numPoints);
extern bool luavals_variadic_to_array(lua_State* L,int argc, Array** ret);
extern bool luavals_variadic_to_array(lua_State* L,int argc, __Array** ret);
extern bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, cocos2d::ValueVector* ret);
template <class T>
@ -224,8 +224,8 @@ extern void physics_raycastinfo_to_luaval(lua_State* L, const PhysicsRayCastInfo
extern void physics_contactdata_to_luaval(lua_State* L, const PhysicsContactData* data);
extern void affinetransform_to_luaval(lua_State* L,const AffineTransform& inValue);
extern void fontdefinition_to_luaval(lua_State* L,const FontDefinition& inValue);
extern void array_to_luaval(lua_State* L,Array* inValue);
extern void dictionary_to_luaval(lua_State* L, Dictionary* dict);
extern void array_to_luaval(lua_State* L, __Array* inValue);
extern void dictionary_to_luaval(lua_State* L, __Dictionary* dict);
template <class T>
void ccvector_to_luaval(lua_State* L,const cocos2d::Vector<T>& inValue)

View File

@ -240,13 +240,13 @@ static int tolua_Cocos2d_WebSocket_createByProtocolArray00(lua_State* tolua_S)
#endif
{
const char *urlName = ((const char*) tolua_tostring(tolua_S,2,0));
Array* protocolArray = ((Array*) tolua_tousertype(tolua_S,3,0));
__Array* protocolArray = ((__Array*) tolua_tousertype(tolua_S,3,0));
std::vector<std::string> protocols;
if (NULL != protocolArray) {
Ref* pObj = NULL;
CCARRAY_FOREACH(protocolArray, pObj)
{
String* pStr = static_cast<String*>(pObj);
__String* pStr = static_cast<__String*>(pObj);
if (NULL != pStr) {
protocols.push_back(pStr->getCString());
}

View File

@ -107,7 +107,6 @@ static int lua_cocos2dx_ArmatureAnimation_setMovementEventCallFunc(lua_State* L)
ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT);
self->setMovementEventCallFunc([=](Armature *armature, MovementEventType movementType, const std::string& movementID){
int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)vec.at(0), ScriptHandlerMgr::HandlerType::ARMATURE_EVENT);
if (0 != handler)
{
@ -178,7 +177,6 @@ static int lua_cocos2dx_ArmatureAnimation_setFrameEventCallFunc(lua_State* L)
ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT);
self->setFrameEventCallFunc([=](Bone *bone, const std::string& frameEventName, int originFrameIndex, int currentFrameIndex){
int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)vec.at(0), ScriptHandlerMgr::HandlerType::ARMATURE_EVENT);
if (0 != handler)
{

View File

@ -33,7 +33,7 @@ USING_NS_CC;
USING_NS_CC_EXT;
template <class T>
bool array_to_vector_t_deprecated(Array& array,Vector<T>& vec)
bool array_to_vector_t_deprecated(__Array& array,Vector<T>& vec)
{
if ( 0 == array.count() )
return false;
@ -50,38 +50,38 @@ bool array_to_vector_t_deprecated(Array& array,Vector<T>& vec)
return true;
}
bool array_to_valuevector_deprecated(Array& array,ValueVector& valueVec)
bool array_to_valuevector_deprecated(__Array& array,ValueVector& valueVec)
{
if (0 == array.count())
return false;
valueVec.clear();
String* strVal = nullptr;
Double* doubleVal = nullptr;
Bool* boolVal = nullptr;
Float* floatVal = nullptr;
Integer* intVal = nullptr;
__String* strVal = nullptr;
__Double* doubleVal = nullptr;
__Bool* boolVal = nullptr;
__Float* floatVal = nullptr;
__Integer* intVal = nullptr;
for (int i = 0; i < array.count(); i++)
{
if( (strVal = dynamic_cast<cocos2d::String *>(array.getObjectAtIndex(i))))
if( (strVal = dynamic_cast<__String *>(array.getObjectAtIndex(i))))
{
valueVec.push_back(Value(strVal->getCString()));
}
else if ((doubleVal = dynamic_cast<cocos2d::Double*>(array.getObjectAtIndex(i))))
else if ((doubleVal = dynamic_cast<__Double*>(array.getObjectAtIndex(i))))
{
valueVec.push_back(Value(doubleVal->getValue()));
}
else if ((floatVal = dynamic_cast<cocos2d::Float*>(array.getObjectAtIndex(i))))
else if ((floatVal = dynamic_cast<__Float*>(array.getObjectAtIndex(i))))
{
valueVec.push_back(Value(floatVal->getValue()));
}
else if ((intVal = dynamic_cast<cocos2d::Integer*>(array.getObjectAtIndex(i))))
else if ((intVal = dynamic_cast<__Integer*>(array.getObjectAtIndex(i))))
{
valueVec.push_back(Value(intVal->getValue()));
}
else if ((boolVal = dynamic_cast<cocos2d::Bool*>(array.getObjectAtIndex(i))))
else if ((boolVal = dynamic_cast<__Bool*>(array.getObjectAtIndex(i))))
{
valueVec.push_back(Value(boolVal->getValue()));
}
@ -487,7 +487,7 @@ static int tolua_Cocos2d_CCArray_create00(lua_State* tolua_S)
#endif
{
{
Array* tolua_ret = (Array*) Array::create();
__Array* tolua_ret = (__Array*) Array::create();
int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;
int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;
toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCArray");
@ -519,7 +519,7 @@ static int tolua_Cocos2d_CCArray_createWithObject00(lua_State* tolua_S)
{
Ref* pObject = ((Ref*) tolua_tousertype(tolua_S,2,0));
{
Array* tolua_ret = (Array*) Array::createWithObject(pObject);
__Array* tolua_ret = (__Array*) __Array::createWithObject(pObject);
int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;
int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;
toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCArray");
@ -549,9 +549,9 @@ static int tolua_Cocos2d_CCArray_createWithArray00(lua_State* tolua_S)
else
#endif
{
Array* otherArray = ((Array*) tolua_tousertype(tolua_S,2,0));
__Array* otherArray = ((__Array*) tolua_tousertype(tolua_S,2,0));
{
Array* tolua_ret = (Array*) Array::createWithArray(otherArray);
__Array* tolua_ret = (__Array*) __Array::createWithArray(otherArray);
int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;
int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;
toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCArray");
@ -584,7 +584,7 @@ static int tolua_Cocos2d_CCArray_createWithCapacity00(lua_State* tolua_S)
{
unsigned int capacity = ((unsigned int) tolua_tonumber(tolua_S,2,0));
{
Array* tolua_ret = (Array*) Array::createWithCapacity(capacity);
__Array* tolua_ret = (__Array*) __Array::createWithCapacity(capacity);
int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;
int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;
toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCArray");
@ -616,7 +616,7 @@ static int tolua_Cocos2d_CCArray_createWithContentsOfFile00(lua_State* tolua_S)
{
const char* pFileName = ((const char*) tolua_tostring(tolua_S,2,0));
{
Array* tolua_ret = (Array*) Array::createWithContentsOfFile(pFileName);
__Array* tolua_ret = (__Array*) __Array::createWithContentsOfFile(pFileName);
int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;
int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;
toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCArray");
@ -645,7 +645,7 @@ static int tolua_Cocos2d_CCArray_count00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'count'", NULL);
#endif
@ -675,7 +675,7 @@ static int tolua_Cocos2d_CCArray_capacity00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'capacity'", NULL);
#endif
@ -708,7 +708,7 @@ static int tolua_Cocos2d_CCArray_indexOfObject00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
Ref* object = ((Ref*) tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'indexOfObject'", NULL);
@ -742,7 +742,7 @@ static int tolua_Cocos2d_CCArray_objectAtIndex00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
unsigned int index = ((unsigned int) tolua_tonumber(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'objectAtIndex'", NULL);
@ -777,7 +777,7 @@ static int tolua_Cocos2d_CCArray_lastObject00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'lastObject'", NULL);
#endif
@ -811,7 +811,7 @@ static int tolua_Cocos2d_CCArray_randomObject00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'randomObject'", NULL);
#endif
@ -846,8 +846,8 @@ static int tolua_Cocos2d_CCArray_isEqualToArray00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
Array* pOtherArray = ((Array*) tolua_tousertype(tolua_S,2,0));
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
__Array* pOtherArray = ((__Array*) tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'isEqualToArray'", NULL);
#endif
@ -880,7 +880,7 @@ static int tolua_Cocos2d_CCArray_containsObject00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
Ref* object = ((Ref*) tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'containsObject'", NULL);
@ -914,7 +914,7 @@ static int tolua_Cocos2d_CCArray_addObject00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
Ref* object = ((Ref*) tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'addObject'", NULL);
@ -946,8 +946,8 @@ static int tolua_Cocos2d_CCArray_addObjectsFromArray00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
Array* otherArray = ((Array*) tolua_tousertype(tolua_S,2,0));
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
__Array* otherArray = ((__Array*) tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'addObjectsFromArray'", NULL);
#endif
@ -980,7 +980,7 @@ static int tolua_Cocos2d_CCArray_insertObject00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
Ref* object = ((Ref*) tolua_tousertype(tolua_S,2,0));
unsigned int index = ((unsigned int) tolua_tonumber(tolua_S,3,0));
#ifndef TOLUA_RELEASE
@ -1013,7 +1013,7 @@ static int tolua_Cocos2d_CCArray_removeLastObject00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
bool bReleaseObj = ((bool) tolua_toboolean(tolua_S,2,true));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'removeLastObject'", NULL);
@ -1047,7 +1047,7 @@ static int tolua_Cocos2d_CCArray_removeObject00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
Ref* object = ((Ref*) tolua_tousertype(tolua_S,2,0));
bool bReleaseObj = ((bool) tolua_toboolean(tolua_S,3,true));
#ifndef TOLUA_RELEASE
@ -1082,7 +1082,7 @@ static int tolua_Cocos2d_CCArray_removeObjectAtIndex00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
unsigned int index = ((unsigned int) tolua_tonumber(tolua_S,2,0));
bool bReleaseObj = ((bool) tolua_toboolean(tolua_S,3,true));
#ifndef TOLUA_RELEASE
@ -1115,8 +1115,8 @@ static int tolua_Cocos2d_CCArray_removeObjectsInArray00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
Array* otherArray = ((Array*) tolua_tousertype(tolua_S,2,0));
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
__Array* otherArray = ((__Array*) tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'removeObjectsInArray'", NULL);
#endif
@ -1146,7 +1146,7 @@ static int tolua_Cocos2d_CCArray_removeAllObjects00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'removeAllObjects'", NULL);
#endif
@ -1177,7 +1177,7 @@ static int tolua_Cocos2d_CCArray_fastRemoveObject00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
Ref* object = ((Ref*) tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'fastRemoveObject'", NULL);
@ -1209,7 +1209,7 @@ static int tolua_Cocos2d_CCArray_fastRemoveObjectAtIndex00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
unsigned int index = ((unsigned int) tolua_tonumber(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'fastRemoveObjectAtIndex'", NULL);
@ -1243,7 +1243,7 @@ static int tolua_Cocos2d_CCArray_exchangeObject00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
Ref* object1 = ((Ref*) tolua_tousertype(tolua_S,2,0));
Ref* object2 = ((Ref*) tolua_tousertype(tolua_S,3,0));
#ifndef TOLUA_RELEASE
@ -1277,7 +1277,7 @@ static int tolua_Cocos2d_CCArray_exchangeObjectAtIndex00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
unsigned int index1 = ((unsigned int) tolua_tonumber(tolua_S,2,0));
unsigned int index2 = ((unsigned int) tolua_tonumber(tolua_S,3,0));
#ifndef TOLUA_RELEASE
@ -1310,7 +1310,7 @@ static int tolua_Cocos2d_CCArray_reverseObjects00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'reverseObjects'", NULL);
#endif
@ -1341,7 +1341,7 @@ static int tolua_Cocos2d_CCArray_reduceMemoryFootprint00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'reduceMemoryFootprint'", NULL);
#endif
@ -1375,7 +1375,7 @@ static int tolua_Cocos2d_CCArray_replaceObjectAtIndex00(lua_State* tolua_S)
else
#endif
{
Array* self = (Array*) tolua_tousertype(tolua_S,1,0);
__Array* self = (__Array*) tolua_tousertype(tolua_S,1,0);
unsigned int uIndex = ((unsigned int) tolua_tonumber(tolua_S,2,0));
Ref* pObject = ((Ref*) tolua_tousertype(tolua_S,3,0));
bool bReleaseObject = ((bool) tolua_toboolean(tolua_S,4,true));
@ -1521,7 +1521,7 @@ static int tolua_Cocos2d_CCString_intValue00(lua_State* tolua_S)
else
#endif
{
const String* self = (const String*) tolua_tousertype(tolua_S,1,0);
const __String* self = (const __String*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'intValue'", NULL);
#endif
@ -1553,7 +1553,7 @@ static int tolua_Cocos2d_CCString_uintValue00(lua_State* tolua_S)
else
#endif
{
const String* self = (const String*) tolua_tousertype(tolua_S,1,0);
const __String* self = (const __String*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'uintValue'", NULL);
#endif
@ -1585,7 +1585,7 @@ static int tolua_Cocos2d_CCString_floatValue00(lua_State* tolua_S)
else
#endif
{
const String* self = (const String*) tolua_tousertype(tolua_S,1,0);
const __String* self = (const __String*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'floatValue'", NULL);
#endif
@ -1617,7 +1617,7 @@ static int tolua_Cocos2d_CCString_doubleValue00(lua_State* tolua_S)
else
#endif
{
const String* self = (const String*) tolua_tousertype(tolua_S,1,0);
const __String* self = (const __String*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'doubleValue'", NULL);
#endif
@ -1649,7 +1649,7 @@ static int tolua_Cocos2d_CCString_boolValue00(lua_State* tolua_S)
else
#endif
{
const String* self = (const String*) tolua_tousertype(tolua_S,1,0);
const __String* self = (const __String*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'boolValue'", NULL);
#endif
@ -1681,7 +1681,7 @@ static int tolua_Cocos2d_CCString_getCString00(lua_State* tolua_S)
else
#endif
{
const String* self = (const String*) tolua_tousertype(tolua_S,1,0);
const __String* self = (const __String*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getCString'", NULL);
#endif
@ -1714,7 +1714,7 @@ static int tolua_Cocos2d_CCString_length00(lua_State* tolua_S)
else
#endif
{
const String* self = (const String*) tolua_tousertype(tolua_S,1,0);
const __String* self = (const __String*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'length'", NULL);
#endif
@ -1747,7 +1747,7 @@ static int tolua_Cocos2d_CCString_compare00(lua_State* tolua_S)
else
#endif
{
const String* self = (const String*) tolua_tousertype(tolua_S,1,0);
const __String* self = (const __String*) tolua_tousertype(tolua_S,1,0);
const char* str = ((const char*) tolua_tostring(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'compare'", NULL);
@ -1782,7 +1782,7 @@ static int tolua_Cocos2d_CCString_isEqual00(lua_State* tolua_S)
else
#endif
{
String* self = (String*) tolua_tousertype(tolua_S,1,0);
__String* self = (__String*) tolua_tousertype(tolua_S,1,0);
const Ref* pObject = ((const Ref*) tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'isEqual'", NULL);
@ -1818,7 +1818,7 @@ static int tolua_Cocos2d_CCString_create00(lua_State* tolua_S)
{
const char* pStr = ((const char*) tolua_tostring(tolua_S,2,0));
{
String* tolua_ret = (String*) String::create(pStr);
__String* tolua_ret = (__String*) String::create(pStr);
int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;
int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;
toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCString");
@ -1852,7 +1852,7 @@ static int tolua_Cocos2d_CCString_createWithData00(lua_State* tolua_S)
unsigned char* pData = ((unsigned char*) tolua_tostring(tolua_S,2,0));
unsigned long nLen = ((unsigned long) tolua_tonumber(tolua_S,3,0));
{
String* tolua_ret = (String*) String::createWithData(pData,nLen);
__String* tolua_ret = (__String*) String::createWithData(pData,nLen);
int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;
int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;
toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCString");
@ -1884,7 +1884,7 @@ static int tolua_Cocos2d_CCString_createWithContentsOfFile00(lua_State* tolua_S)
{
const char* pszFileName = ((const char*) tolua_tostring(tolua_S,2,0));
{
String* tolua_ret = (String*) String::createWithContentsOfFile(pszFileName);
__String* tolua_ret = (__String*) String::createWithContentsOfFile(pszFileName);
int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;
int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;
toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCString");
@ -1953,7 +1953,7 @@ static int tolua_cocos2d_Animation_createWithSpriteFrames_deprecated00(lua_State
goto tolua_lerror;
else
{
Array* arrayOfSpriteFrameNames = ((Array*) tolua_tousertype(tolua_S,2,0));
__Array* arrayOfSpriteFrameNames = ((__Array*) tolua_tousertype(tolua_S,2,0));
Vector<SpriteFrame*> vec;
array_to_vector_t_deprecated(*arrayOfSpriteFrameNames, vec);
float delay = ((float) tolua_tonumber(tolua_S,3,0));
@ -1979,7 +1979,7 @@ static int tolua_cocos2d_Animation_createWithSpriteFrames_deprecated01(lua_State
goto tolua_lerror;
else
{
Array* arrayOfSpriteFrameNames = ((Array*) tolua_tousertype(tolua_S,2,0));
__Array* arrayOfSpriteFrameNames = ((__Array*) tolua_tousertype(tolua_S,2,0));
Vector<SpriteFrame*> vec;
array_to_vector_t_deprecated(*arrayOfSpriteFrameNames, vec);
cocos2d::Animation* tolua_ret = (cocos2d::Animation*) cocos2d::Animation::createWithSpriteFrames(vec);
@ -2052,7 +2052,7 @@ static int tolua_Cocos2d_Sequence_create_deprecated00(lua_State* tolua_S)
goto tolua_lerror;
else
{
Array* actions = ((Array*) tolua_tousertype(tolua_S,2,0));
__Array* actions = ((__Array*) tolua_tousertype(tolua_S,2,0));
Vector<FiniteTimeAction*> vec;
array_to_vector_t_deprecated(*actions, vec);
Sequence* tolua_ret = (Sequence*) Sequence::create(vec);
@ -2203,7 +2203,7 @@ static int tolua_cocos2d_Menu_createWithArray00(lua_State* tolua_S)
else
#endif
{
Array* arrayOfItems = ((Array*) tolua_tousertype(tolua_S,2,0));
__Array* arrayOfItems = ((__Array*) tolua_tousertype(tolua_S,2,0));
Vector<MenuItem*> vec;
array_to_vector_t_deprecated(*arrayOfItems, vec);
Menu* tolua_ret = (Menu*) Menu::createWithArray(vec);
@ -2233,7 +2233,7 @@ static int tolua_cocos2d_Menu_alignItemsInColumnsWithArray00(lua_State* tolua_S)
#endif
{
Menu* self = (Menu*) tolua_tousertype(tolua_S,1,0);
Array* rows = ((Array*) tolua_tousertype(tolua_S,2,0));
__Array* rows = ((__Array*) tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'alignItemsInColumnsWithArray'", NULL);
#endif
@ -2264,7 +2264,7 @@ static int tolua_cocos2d_Menu_alignItemsInRowsWithArray00(lua_State* tolua_S)
#endif
{
Menu* self = (Menu*) tolua_tousertype(tolua_S,1,0);
Array* columns = ((Array*) tolua_tousertype(tolua_S,2,0));
__Array* columns = ((__Array*) tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'alignItemsInRowsWithArray'", NULL);
#endif
@ -2307,7 +2307,7 @@ static int tolua_cocos2d_LayerMultiplex_createWithArray00(lua_State* tolua_S)
else
#endif
{
Array* arrayOfLayers = ((Array*) tolua_tousertype(tolua_S,2,0));
__Array* arrayOfLayers = ((__Array*) tolua_tousertype(tolua_S,2,0));
Vector<Layer*> vec;
array_to_vector_t_deprecated(*arrayOfLayers, vec);
LayerMultiplex* tolua_ret = (LayerMultiplex*) LayerMultiplex::createWithArray(vec);

View File

@ -1116,10 +1116,10 @@ static int lua_cocos2dx_TableView_setDelegate(lua_State* L)
if (nullptr == delegate)
return 0;
Dictionary* userDict = static_cast<Dictionary*>(self->getUserObject());
__Dictionary* userDict = static_cast<__Dictionary*>(self->getUserObject());
if (nullptr == userDict)
{
userDict = new Dictionary();
userDict = new __Dictionary();
if (NULL == userDict)
return 0;
@ -1253,10 +1253,10 @@ static int lua_cocos2dx_TableView_setDataSource(lua_State* L)
if (nullptr == dataSource)
return 0;
Dictionary* userDict = static_cast<Dictionary*>(self->getUserObject());
__Dictionary* userDict = static_cast<__Dictionary*>(self->getUserObject());
if (nullptr == userDict)
{
userDict = new Dictionary();
userDict = new __Dictionary();
if (NULL == userDict)
return 0;
@ -1324,7 +1324,7 @@ static int lua_cocos2dx_TableView_create(lua_State* L)
ret->reloadData();
Dictionary* userDict = new Dictionary();
__Dictionary* userDict = new __Dictionary();
userDict->setObject(dataSource, KEY_TABLEVIEW_DATA_SOURCE);
ret->setUserObject(userDict);
userDict->release();

View File

@ -1 +1 @@
eb7d91c43b6712c049d8afbbdff2952ed47537fb
49e177aafe2822631bfae335acd747bf1e03e55b

View File

@ -21,13 +21,13 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "lua_cocos2dx_gui_manual.hpp"
#include "lua_cocos2dx_ui_manual.hpp"
#include "cocos2d.h"
#include "tolua_fix.h"
#include "LuaBasicConversions.h"
#include "LuaScriptHandlerMgr.h"
#include "CCLuaValue.h"
#include "CocosGUI.h"
#include "ui/CocosGUI.h"
#include "CCLuaEngine.h"
using namespace ui;

View File

@ -664,7 +664,6 @@ static int lua_get_XMLHttpRequest_response(lua_State* L)
return 0;
}
int nRet = 0;
LuaValueArray array;
uint8_t* tmpData = new uint8_t[self->getDataSize()];

View File

@ -17,10 +17,6 @@
1AACE7BC18BC45C200215002 /* lua_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE74C18BC45C200215002 /* lua_cocos2dx_extension_auto.cpp */; };
1AACE7BD18BC45C200215002 /* lua_cocos2dx_extension_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE74D18BC45C200215002 /* lua_cocos2dx_extension_auto.hpp */; };
1AACE7BE18BC45C200215002 /* lua_cocos2dx_extension_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE74D18BC45C200215002 /* lua_cocos2dx_extension_auto.hpp */; };
1AACE7C118BC45C200215002 /* lua_cocos2dx_gui_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE74F18BC45C200215002 /* lua_cocos2dx_gui_auto.cpp */; };
1AACE7C218BC45C200215002 /* lua_cocos2dx_gui_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE74F18BC45C200215002 /* lua_cocos2dx_gui_auto.cpp */; };
1AACE7C318BC45C200215002 /* lua_cocos2dx_gui_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE75018BC45C200215002 /* lua_cocos2dx_gui_auto.hpp */; };
1AACE7C418BC45C200215002 /* lua_cocos2dx_gui_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE75018BC45C200215002 /* lua_cocos2dx_gui_auto.hpp */; };
1AACE7C718BC45C200215002 /* lua_cocos2dx_physics_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE75218BC45C200215002 /* lua_cocos2dx_physics_auto.cpp */; };
1AACE7C818BC45C200215002 /* lua_cocos2dx_physics_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE75218BC45C200215002 /* lua_cocos2dx_physics_auto.cpp */; };
1AACE7C918BC45C200215002 /* lua_cocos2dx_physics_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE75318BC45C200215002 /* lua_cocos2dx_physics_auto.hpp */; };
@ -69,10 +65,6 @@
1AACE7FA18BC45C200215002 /* lua_cocos2dx_extension_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE76E18BC45C200215002 /* lua_cocos2dx_extension_manual.cpp */; };
1AACE7FB18BC45C200215002 /* lua_cocos2dx_extension_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE76F18BC45C200215002 /* lua_cocos2dx_extension_manual.h */; };
1AACE7FC18BC45C200215002 /* lua_cocos2dx_extension_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE76F18BC45C200215002 /* lua_cocos2dx_extension_manual.h */; };
1AACE7FD18BC45C200215002 /* lua_cocos2dx_gui_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE77018BC45C200215002 /* lua_cocos2dx_gui_manual.cpp */; };
1AACE7FE18BC45C200215002 /* lua_cocos2dx_gui_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE77018BC45C200215002 /* lua_cocos2dx_gui_manual.cpp */; };
1AACE7FF18BC45C200215002 /* lua_cocos2dx_gui_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE77118BC45C200215002 /* lua_cocos2dx_gui_manual.hpp */; };
1AACE80018BC45C200215002 /* lua_cocos2dx_gui_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE77118BC45C200215002 /* lua_cocos2dx_gui_manual.hpp */; };
1AACE80118BC45C200215002 /* lua_cocos2dx_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE77218BC45C200215002 /* lua_cocos2dx_manual.cpp */; };
1AACE80218BC45C200215002 /* lua_cocos2dx_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE77218BC45C200215002 /* lua_cocos2dx_manual.cpp */; };
1AACE80318BC45C200215002 /* lua_cocos2dx_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1AACE77318BC45C200215002 /* lua_cocos2dx_manual.hpp */; };
@ -207,6 +199,14 @@
1ABCA26F18CD8F7D0087CE3A /* usocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ABCA22E18CD8F7D0087CE3A /* usocket.h */; };
1ABCA27018CD8F7D0087CE3A /* usocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ABCA22E18CD8F7D0087CE3A /* usocket.h */; };
1ABCA36318CD9D7F0087CE3A /* libluajit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA1F618CD8F5F0087CE3A /* libluajit.a */; };
2905FAD018CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2905FACE18CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp */; };
2905FAD118CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2905FACE18CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp */; };
2905FAD218CF12E600240AA3 /* lua_cocos2dx_ui_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2905FACF18CF12E600240AA3 /* lua_cocos2dx_ui_auto.hpp */; };
2905FAD318CF12E600240AA3 /* lua_cocos2dx_ui_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2905FACF18CF12E600240AA3 /* lua_cocos2dx_ui_auto.hpp */; };
2905FAD618CF143800240AA3 /* lua_cocos2dx_ui_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2905FAD418CF143800240AA3 /* lua_cocos2dx_ui_manual.cpp */; };
2905FAD718CF143800240AA3 /* lua_cocos2dx_ui_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2905FAD418CF143800240AA3 /* lua_cocos2dx_ui_manual.cpp */; };
2905FAD818CF143800240AA3 /* lua_cocos2dx_ui_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2905FAD518CF143800240AA3 /* lua_cocos2dx_ui_manual.hpp */; };
2905FAD918CF143800240AA3 /* lua_cocos2dx_ui_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2905FAD518CF143800240AA3 /* lua_cocos2dx_ui_manual.hpp */; };
C0FEF4D618BE0E70001F446C /* lua_debugger.c in Sources */ = {isa = PBXBuildFile; fileRef = C0FEF4D418BE0E70001F446C /* lua_debugger.c */; };
C0FEF4D718BE0E70001F446C /* lua_debugger.c in Sources */ = {isa = PBXBuildFile; fileRef = C0FEF4D418BE0E70001F446C /* lua_debugger.c */; };
C0FEF4D818BE0E70001F446C /* lua_debugger.h in Headers */ = {isa = PBXBuildFile; fileRef = C0FEF4D518BE0E70001F446C /* lua_debugger.h */; };
@ -221,8 +221,6 @@
1AACE74A18BC45C200215002 /* lua_cocos2dx_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_auto.hpp; sourceTree = "<group>"; };
1AACE74C18BC45C200215002 /* lua_cocos2dx_extension_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_extension_auto.cpp; sourceTree = "<group>"; };
1AACE74D18BC45C200215002 /* lua_cocos2dx_extension_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_extension_auto.hpp; sourceTree = "<group>"; };
1AACE74F18BC45C200215002 /* lua_cocos2dx_gui_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_gui_auto.cpp; sourceTree = "<group>"; };
1AACE75018BC45C200215002 /* lua_cocos2dx_gui_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_gui_auto.hpp; sourceTree = "<group>"; };
1AACE75218BC45C200215002 /* lua_cocos2dx_physics_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_physics_auto.cpp; sourceTree = "<group>"; };
1AACE75318BC45C200215002 /* lua_cocos2dx_physics_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_physics_auto.hpp; sourceTree = "<group>"; };
1AACE75518BC45C200215002 /* lua_cocos2dx_spine_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_spine_auto.cpp; sourceTree = "<group>"; };
@ -247,8 +245,6 @@
1AACE76D18BC45C200215002 /* lua_cocos2dx_deprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_cocos2dx_deprecated.h; sourceTree = "<group>"; };
1AACE76E18BC45C200215002 /* lua_cocos2dx_extension_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_extension_manual.cpp; sourceTree = "<group>"; };
1AACE76F18BC45C200215002 /* lua_cocos2dx_extension_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_cocos2dx_extension_manual.h; sourceTree = "<group>"; };
1AACE77018BC45C200215002 /* lua_cocos2dx_gui_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_gui_manual.cpp; sourceTree = "<group>"; };
1AACE77118BC45C200215002 /* lua_cocos2dx_gui_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_gui_manual.hpp; sourceTree = "<group>"; };
1AACE77218BC45C200215002 /* lua_cocos2dx_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_manual.cpp; sourceTree = "<group>"; };
1AACE77318BC45C200215002 /* lua_cocos2dx_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_manual.hpp; sourceTree = "<group>"; };
1AACE77418BC45C200215002 /* lua_cocos2dx_physics_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_physics_manual.cpp; sourceTree = "<group>"; };
@ -317,6 +313,10 @@
1ABCA22C18CD8F7D0087CE3A /* unix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unix.h; sourceTree = "<group>"; };
1ABCA22D18CD8F7D0087CE3A /* usocket.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = usocket.c; sourceTree = "<group>"; };
1ABCA22E18CD8F7D0087CE3A /* usocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = usocket.h; sourceTree = "<group>"; };
2905FACE18CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_ui_auto.cpp; sourceTree = "<group>"; };
2905FACF18CF12E600240AA3 /* lua_cocos2dx_ui_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_ui_auto.hpp; sourceTree = "<group>"; };
2905FAD418CF143800240AA3 /* lua_cocos2dx_ui_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_ui_manual.cpp; sourceTree = "<group>"; };
2905FAD518CF143800240AA3 /* lua_cocos2dx_ui_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_ui_manual.hpp; sourceTree = "<group>"; };
C0FEF4D418BE0E70001F446C /* lua_debugger.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lua_debugger.c; sourceTree = "<group>"; };
C0FEF4D518BE0E70001F446C /* lua_debugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_debugger.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
@ -355,12 +355,12 @@
1AACE74818BC45C200215002 /* auto */ = {
isa = PBXGroup;
children = (
2905FACE18CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp */,
2905FACF18CF12E600240AA3 /* lua_cocos2dx_ui_auto.hpp */,
1AACE74918BC45C200215002 /* lua_cocos2dx_auto.cpp */,
1AACE74A18BC45C200215002 /* lua_cocos2dx_auto.hpp */,
1AACE74C18BC45C200215002 /* lua_cocos2dx_extension_auto.cpp */,
1AACE74D18BC45C200215002 /* lua_cocos2dx_extension_auto.hpp */,
1AACE74F18BC45C200215002 /* lua_cocos2dx_gui_auto.cpp */,
1AACE75018BC45C200215002 /* lua_cocos2dx_gui_auto.hpp */,
1AACE75218BC45C200215002 /* lua_cocos2dx_physics_auto.cpp */,
1AACE75318BC45C200215002 /* lua_cocos2dx_physics_auto.hpp */,
1AACE75518BC45C200215002 /* lua_cocos2dx_spine_auto.cpp */,
@ -375,6 +375,8 @@
1AACE75B18BC45C200215002 /* manual */ = {
isa = PBXGroup;
children = (
2905FAD418CF143800240AA3 /* lua_cocos2dx_ui_manual.cpp */,
2905FAD518CF143800240AA3 /* lua_cocos2dx_ui_manual.hpp */,
1AACE75E18BC45C200215002 /* CCBProxy.cpp */,
C0FEF4D418BE0E70001F446C /* lua_debugger.c */,
C0FEF4D518BE0E70001F446C /* lua_debugger.h */,
@ -395,8 +397,6 @@
1AACE76D18BC45C200215002 /* lua_cocos2dx_deprecated.h */,
1AACE76E18BC45C200215002 /* lua_cocos2dx_extension_manual.cpp */,
1AACE76F18BC45C200215002 /* lua_cocos2dx_extension_manual.h */,
1AACE77018BC45C200215002 /* lua_cocos2dx_gui_manual.cpp */,
1AACE77118BC45C200215002 /* lua_cocos2dx_gui_manual.hpp */,
1AACE77218BC45C200215002 /* lua_cocos2dx_manual.cpp */,
1AACE77318BC45C200215002 /* lua_cocos2dx_manual.hpp */,
1AACE77418BC45C200215002 /* lua_cocos2dx_physics_manual.cpp */,
@ -581,10 +581,10 @@
1ABCA24418CD8F7D0087CE3A /* luasocket_buffer.h in Headers */,
1AACE82418BC45C200215002 /* LuaScriptHandlerMgr.h in Headers */,
1AACE7FC18BC45C200215002 /* lua_cocos2dx_extension_manual.h in Headers */,
1AACE80018BC45C200215002 /* lua_cocos2dx_gui_manual.hpp in Headers */,
2905FAD318CF12E600240AA3 /* lua_cocos2dx_ui_auto.hpp in Headers */,
1AACE7EC18BC45C200215002 /* CCLuaValue.h in Headers */,
2905FAD918CF143800240AA3 /* lua_cocos2dx_ui_manual.hpp in Headers */,
1AACE80C18BC45C200215002 /* lua_cocos2dx_spine_manual.hpp in Headers */,
1AACE7C418BC45C200215002 /* lua_cocos2dx_gui_auto.hpp in Headers */,
1ABCA25018CD8F7D0087CE3A /* options.h in Headers */,
1ABCA1F118CD8F470087CE3A /* lualib.h in Headers */,
1ABCA20318CD8F6E0087CE3A /* tolua_event.h in Headers */,
@ -639,10 +639,10 @@
1ABCA24318CD8F7D0087CE3A /* luasocket_buffer.h in Headers */,
1AACE82318BC45C200215002 /* LuaScriptHandlerMgr.h in Headers */,
1AACE7FB18BC45C200215002 /* lua_cocos2dx_extension_manual.h in Headers */,
1AACE7FF18BC45C200215002 /* lua_cocos2dx_gui_manual.hpp in Headers */,
2905FAD218CF12E600240AA3 /* lua_cocos2dx_ui_auto.hpp in Headers */,
1AACE7EB18BC45C200215002 /* CCLuaValue.h in Headers */,
2905FAD818CF143800240AA3 /* lua_cocos2dx_ui_manual.hpp in Headers */,
1AACE80B18BC45C200215002 /* lua_cocos2dx_spine_manual.hpp in Headers */,
1AACE7C318BC45C200215002 /* lua_cocos2dx_gui_auto.hpp in Headers */,
1ABCA24F18CD8F7D0087CE3A /* options.h in Headers */,
1ABCA1F018CD8F470087CE3A /* lualib.h in Headers */,
1ABCA20218CD8F6E0087CE3A /* tolua_event.h in Headers */,
@ -741,7 +741,6 @@
1ABCA24E18CD8F7D0087CE3A /* options.c in Sources */,
1A262AB918BEEF5900D2DB92 /* tolua_fix.cpp in Sources */,
1AACE81E18BC45C200215002 /* LuaOpengl.cpp in Sources */,
1AACE7C218BC45C200215002 /* lua_cocos2dx_gui_auto.cpp in Sources */,
1AACE7CE18BC45C200215002 /* lua_cocos2dx_spine_auto.cpp in Sources */,
1AACE80218BC45C200215002 /* lua_cocos2dx_manual.cpp in Sources */,
1ABCA24618CD8F7D0087CE3A /* luasocket_io.c in Sources */,
@ -752,6 +751,7 @@
1ABCA26618CD8F7D0087CE3A /* udp.c in Sources */,
1AACE82218BC45C200215002 /* LuaScriptHandlerMgr.cpp in Sources */,
1ABCA23618CD8F7D0087CE3A /* except.c in Sources */,
2905FAD718CF143800240AA3 /* lua_cocos2dx_ui_manual.cpp in Sources */,
1ABCA26A18CD8F7D0087CE3A /* unix.c in Sources */,
1AACE7F218BC45C200215002 /* lua_cocos2dx_coco_studio_manual.cpp in Sources */,
1AACE80E18BC45C200215002 /* lua_extensions.c in Sources */,
@ -769,6 +769,7 @@
1AACE7DA18BC45C200215002 /* CCBProxy.cpp in Sources */,
1AACE81618BC45C200215002 /* lua_xml_http_request.cpp in Sources */,
1ABCA23A18CD8F7D0087CE3A /* inet.c in Sources */,
2905FAD118CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp in Sources */,
1AACE7E218BC45C200215002 /* CCLuaEngine.cpp in Sources */,
1ABCA26E18CD8F7D0087CE3A /* usocket.c in Sources */,
1AACE81218BC45C200215002 /* Lua_web_socket.cpp in Sources */,
@ -783,7 +784,6 @@
1ABCA20718CD8F6E0087CE3A /* tolua_map.c in Sources */,
1ABCA25618CD8F7D0087CE3A /* serial.c in Sources */,
1ABCA20B18CD8F6E0087CE3A /* tolua_to.c in Sources */,
1AACE7FE18BC45C200215002 /* lua_cocos2dx_gui_manual.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -798,7 +798,6 @@
1ABCA24D18CD8F7D0087CE3A /* options.c in Sources */,
1A262AB818BEEF5900D2DB92 /* tolua_fix.cpp in Sources */,
1AACE81D18BC45C200215002 /* LuaOpengl.cpp in Sources */,
1AACE7C118BC45C200215002 /* lua_cocos2dx_gui_auto.cpp in Sources */,
1AACE7CD18BC45C200215002 /* lua_cocos2dx_spine_auto.cpp in Sources */,
1AACE80118BC45C200215002 /* lua_cocos2dx_manual.cpp in Sources */,
1ABCA24518CD8F7D0087CE3A /* luasocket_io.c in Sources */,
@ -809,6 +808,7 @@
1ABCA26518CD8F7D0087CE3A /* udp.c in Sources */,
1AACE82118BC45C200215002 /* LuaScriptHandlerMgr.cpp in Sources */,
1ABCA23518CD8F7D0087CE3A /* except.c in Sources */,
2905FAD618CF143800240AA3 /* lua_cocos2dx_ui_manual.cpp in Sources */,
1ABCA26918CD8F7D0087CE3A /* unix.c in Sources */,
1AACE7F118BC45C200215002 /* lua_cocos2dx_coco_studio_manual.cpp in Sources */,
1AACE80D18BC45C200215002 /* lua_extensions.c in Sources */,
@ -826,6 +826,7 @@
1AACE7D918BC45C200215002 /* CCBProxy.cpp in Sources */,
1AACE81518BC45C200215002 /* lua_xml_http_request.cpp in Sources */,
1ABCA23918CD8F7D0087CE3A /* inet.c in Sources */,
2905FAD018CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp in Sources */,
1AACE7E118BC45C200215002 /* CCLuaEngine.cpp in Sources */,
1ABCA26D18CD8F7D0087CE3A /* usocket.c in Sources */,
1AACE81118BC45C200215002 /* Lua_web_socket.cpp in Sources */,
@ -840,7 +841,6 @@
1ABCA20618CD8F6E0087CE3A /* tolua_map.c in Sources */,
1ABCA25518CD8F7D0087CE3A /* serial.c in Sources */,
1ABCA20A18CD8F6E0087CE3A /* tolua_to.c in Sources */,
1AACE7FD18BC45C200215002 /* lua_cocos2dx_gui_manual.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -881,7 +881,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../.. $(SRCROOT)/../../.. $(SRCROOT)/../../../base $(SRCROOT)/../../../2d $(SRCROOT)/../../../physics $(SRCROOT)/../../../math/kazmath $(SRCROOT)/../../../2d/platform $(SRCROOT)/../../../audio/include $(SRCROOT)/../../../editor-support $(SRCROOT)/../../../editor-support/spine $(SRCROOT)/../../../editor-support/cocostudio $(SRCROOT)/../../../editor-support/cocosbuilder $(SRCROOT)/../../../gui $(SRCROOT)/../../../storage $(SRCROOT)/../../../../extensions $(SRCROOT)/../../../../external $(SRCROOT)/../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../external/lua $(SRCROOT)/../../../../external/lua/luajit/include $(SRCROOT)/../../../../external/lua/tolua";
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../.. $(SRCROOT)/../../.. $(SRCROOT)/../../../base $(SRCROOT)/../../../2d $(SRCROOT)/../../../physics $(SRCROOT)/../../../math/kazmath $(SRCROOT)/../../../2d/platform $(SRCROOT)/../../../audio/include $(SRCROOT)/../../../editor-support $(SRCROOT)/../../../editor-support/spine $(SRCROOT)/../../../editor-support/cocostudio $(SRCROOT)/../../../editor-support/cocosbuilder $(SRCROOT)/../../../ui $(SRCROOT)/../../../storage $(SRCROOT)/../../../../extensions $(SRCROOT)/../../../../external $(SRCROOT)/../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../external/lua $(SRCROOT)/../../../../external/lua/luajit/include $(SRCROOT)/../../../../external/lua/tolua";
};
name = Debug;
};
@ -914,7 +914,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../.. $(SRCROOT)/../../.. $(SRCROOT)/../../../base $(SRCROOT)/../../../2d $(SRCROOT)/../../../physics $(SRCROOT)/../../../math/kazmath $(SRCROOT)/../../../2d/platform $(SRCROOT)/../../../audio/include $(SRCROOT)/../../../editor-support $(SRCROOT)/../../../editor-support/spine $(SRCROOT)/../../../editor-support/cocostudio $(SRCROOT)/../../../editor-support/cocosbuilder $(SRCROOT)/../../../gui $(SRCROOT)/../../../storage $(SRCROOT)/../../../../extensions $(SRCROOT)/../../../../external $(SRCROOT)/../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../external/lua $(SRCROOT)/../../../../external/lua/luajit/include $(SRCROOT)/../../../../external/lua/tolua";
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../.. $(SRCROOT)/../../.. $(SRCROOT)/../../../base $(SRCROOT)/../../../2d $(SRCROOT)/../../../physics $(SRCROOT)/../../../math/kazmath $(SRCROOT)/../../../2d/platform $(SRCROOT)/../../../audio/include $(SRCROOT)/../../../editor-support $(SRCROOT)/../../../editor-support/spine $(SRCROOT)/../../../editor-support/cocostudio $(SRCROOT)/../../../editor-support/cocosbuilder $(SRCROOT)/../../../ui $(SRCROOT)/../../../storage $(SRCROOT)/../../../../extensions $(SRCROOT)/../../../../external $(SRCROOT)/../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../external/lua $(SRCROOT)/../../../../external/lua/luajit/include $(SRCROOT)/../../../../external/lua/tolua";
VALIDATE_PRODUCT = YES;
};
name = Release;

View File

@ -32,10 +32,10 @@
<ClCompile Include="..\..\..\..\external\lua\tolua\tolua_to.c" />
<ClCompile Include="..\auto\lua_cocos2dx_auto.cpp" />
<ClCompile Include="..\auto\lua_cocos2dx_extension_auto.cpp" />
<ClCompile Include="..\auto\lua_cocos2dx_gui_auto.cpp" />
<ClCompile Include="..\auto\lua_cocos2dx_physics_auto.cpp" />
<ClCompile Include="..\auto\lua_cocos2dx_spine_auto.cpp" />
<ClCompile Include="..\auto\lua_cocos2dx_studio_auto.cpp" />
<ClCompile Include="..\auto\lua_cocos2dx_ui_auto.cpp" />
<ClCompile Include="..\manual\CCBProxy.cpp" />
<ClCompile Include="..\manual\CCLuaBridge.cpp" />
<ClCompile Include="..\manual\CCLuaEngine.cpp" />
@ -49,10 +49,10 @@
<ClCompile Include="..\manual\lua_cocos2dx_coco_studio_manual.cpp" />
<ClCompile Include="..\manual\lua_cocos2dx_deprecated.cpp" />
<ClCompile Include="..\manual\lua_cocos2dx_extension_manual.cpp" />
<ClCompile Include="..\manual\lua_cocos2dx_gui_manual.cpp" />
<ClCompile Include="..\manual\lua_cocos2dx_manual.cpp" />
<ClCompile Include="..\manual\lua_cocos2dx_physics_manual.cpp" />
<ClCompile Include="..\manual\lua_cocos2dx_spine_manual.cpp" />
<ClCompile Include="..\manual\lua_cocos2dx_ui_manual.cpp" />
<ClCompile Include="..\manual\lua_debugger.c" />
<ClCompile Include="..\manual\lua_extensions.c" />
<ClCompile Include="..\manual\Lua_web_socket.cpp" />
@ -83,10 +83,10 @@
<ClInclude Include="..\..\..\..\external\lua\tolua\tolua_event.h" />
<ClInclude Include="..\auto\lua_cocos2dx_auto.hpp" />
<ClInclude Include="..\auto\lua_cocos2dx_extension_auto.hpp" />
<ClInclude Include="..\auto\lua_cocos2dx_gui_auto.hpp" />
<ClInclude Include="..\auto\lua_cocos2dx_physics_auto.hpp" />
<ClInclude Include="..\auto\lua_cocos2dx_spine_auto.hpp" />
<ClInclude Include="..\auto\lua_cocos2dx_studio_auto.hpp" />
<ClInclude Include="..\auto\lua_cocos2dx_ui_auto.hpp" />
<ClInclude Include="..\manual\CCBProxy.h" />
<ClInclude Include="..\manual\CCLuaBridge.h" />
<ClInclude Include="..\manual\CCLuaEngine.h" />
@ -100,10 +100,10 @@
<ClInclude Include="..\manual\lua_cocos2dx_coco_studio_manual.hpp" />
<ClInclude Include="..\manual\lua_cocos2dx_deprecated.h" />
<ClInclude Include="..\manual\lua_cocos2dx_extension_manual.h" />
<ClInclude Include="..\manual\lua_cocos2dx_gui_manual.hpp" />
<ClInclude Include="..\manual\lua_cocos2dx_manual.hpp" />
<ClInclude Include="..\manual\lua_cocos2dx_physics_manual.hpp" />
<ClInclude Include="..\manual\lua_cocos2dx_spine_manual.hpp" />
<ClInclude Include="..\manual\lua_cocos2dx_ui_manual.hpp" />
<ClInclude Include="..\manual\lua_debugger.h" />
<ClInclude Include="..\manual\lua_extensions.h" />
<ClInclude Include="..\manual\Lua_web_socket.h" />
@ -184,7 +184,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot)extensions\network;$(EngineRoot)external;$(EngineRoot)external\libwebsockets\win32\include;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\lua\luajit\include;$(EngineRoot)external\lua;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot)extensions\network;$(EngineRoot)external;$(EngineRoot)external\libwebsockets\win32\include;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\lua\luajit\include;$(EngineRoot)external\lua;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@ -216,7 +216,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\lua\luajit\prebuilt\win32\*.*" "$
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot)extensions\network;$(EngineRoot)external;$(EngineRoot)external\libwebsockets\win32\include;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\lua\luajit\include;$(EngineRoot)external\lua;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\editor-support\cocostudio;$(EngineRoot)cocos\editor-support\cocosbuilder;$(EngineRoot)cocos\editor-support\spine;$(EngineRoot)cocos\audio\include;$(EngineRoot)extensions;$(EngineRoot)extensions\network;$(EngineRoot)external;$(EngineRoot)external\libwebsockets\win32\include;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\lua\luajit\include;$(EngineRoot)external\lua;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBLUA_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>

View File

@ -21,7 +21,7 @@
<ClCompile Include="..\auto\lua_cocos2dx_extension_auto.cpp">
<Filter>auto</Filter>
</ClCompile>
<ClCompile Include="..\auto\lua_cocos2dx_gui_auto.cpp">
<ClCompile Include="..\auto\lua_cocos2dx_ui_auto.cpp">
<Filter>auto</Filter>
</ClCompile>
<ClCompile Include="..\auto\lua_cocos2dx_physics_auto.cpp">
@ -60,7 +60,7 @@
<ClCompile Include="..\manual\lua_cocos2dx_extension_manual.cpp">
<Filter>manual</Filter>
</ClCompile>
<ClCompile Include="..\manual\lua_cocos2dx_gui_manual.cpp">
<ClCompile Include="..\manual\lua_cocos2dx_ui_manual.cpp">
<Filter>manual</Filter>
</ClCompile>
<ClCompile Include="..\manual\lua_cocos2dx_manual.cpp">
@ -164,7 +164,7 @@
<ClInclude Include="..\auto\lua_cocos2dx_extension_auto.hpp">
<Filter>auto</Filter>
</ClInclude>
<ClInclude Include="..\auto\lua_cocos2dx_gui_auto.hpp">
<ClInclude Include="..\auto\lua_cocos2dx_ui_auto.hpp">
<Filter>auto</Filter>
</ClInclude>
<ClInclude Include="..\auto\lua_cocos2dx_physics_auto.hpp">
@ -203,7 +203,7 @@
<ClInclude Include="..\manual\lua_cocos2dx_extension_manual.h">
<Filter>manual</Filter>
</ClInclude>
<ClInclude Include="..\manual\lua_cocos2dx_gui_manual.hpp">
<ClInclude Include="..\manual\lua_cocos2dx_ui_manual.hpp">
<Filter>manual</Filter>
</ClInclude>
<ClInclude Include="..\manual\lua_cocos2dx_manual.hpp">
@ -362,4 +362,4 @@
<Filter>script</Filter>
</None>
</ItemGroup>
</Project>
</Project>

View File

@ -1,9 +1,9 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := cocos_gui_static
LOCAL_MODULE := cocos_ui_static
LOCAL_MODULE_FILENAME := libgui
LOCAL_MODULE_FILENAME := libui
LOCAL_SRC_FILES := \
UIWidget.cpp \

View File

@ -20,11 +20,11 @@ set(GUI_SRC
UIRichText.cpp
)
add_library(gui STATIC
add_library(ui STATIC
${GUI_SRC}
)
set_target_properties(gui
set_target_properties(ui
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"

View File

@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "gui/CocosGUI.h"
#include "ui/CocosGUI.h"
NS_CC_BEGIN

View File

@ -26,22 +26,22 @@ THE SOFTWARE.
#define __COCOSGUI_H__
#include "gui/UIWidget.h"
#include "gui/UILayout.h"
#include "gui/UIButton.h"
#include "gui/UICheckBox.h"
#include "gui/UIImageView.h"
#include "gui/UIText.h"
#include "gui/UITextAtlas.h"
#include "gui/UILoadingBar.h"
#include "gui/UIScrollView.h"
#include "gui/UIListView.h"
#include "gui/UISlider.h"
#include "gui/UITextField.h"
#include "gui/UITextBMFont.h"
#include "gui/UIPageView.h"
#include "gui/UIHelper.h"
#include "gui/UIRichText.h"
#include "ui/UIWidget.h"
#include "ui/UILayout.h"
#include "ui/UIButton.h"
#include "ui/UICheckBox.h"
#include "ui/UIImageView.h"
#include "ui/UIText.h"
#include "ui/UITextAtlas.h"
#include "ui/UILoadingBar.h"
#include "ui/UIScrollView.h"
#include "ui/UIListView.h"
#include "ui/UISlider.h"
#include "ui/UITextField.h"
#include "ui/UITextBMFont.h"
#include "ui/UIPageView.h"
#include "ui/UIHelper.h"
#include "ui/UIRichText.h"
NS_CC_BEGIN
namespace ui {

View File

@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "gui/UIButton.h"
#include "ui/UIButton.h"
#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h"
NS_CC_BEGIN

View File

@ -25,7 +25,7 @@ THE SOFTWARE.
#ifndef __UIBUTTON_H__
#define __UIBUTTON_H__
#include "gui/UIWidget.h"
#include "ui/UIWidget.h"
NS_CC_BEGIN

View File

@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "gui/UICheckBox.h"
#include "ui/UICheckBox.h"
NS_CC_BEGIN

View File

@ -25,7 +25,7 @@ THE SOFTWARE.
#ifndef __UICHECKBOX_H__
#define __UICHECKBOX_H__
#include "gui/UIWidget.h"
#include "ui/UIWidget.h"
NS_CC_BEGIN

View File

@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "gui/UIImageView.h"
#include "ui/UIImageView.h"
#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h"
NS_CC_BEGIN

View File

@ -25,7 +25,7 @@ THE SOFTWARE.
#ifndef __UIIMAGEVIEW_H__
#define __UIIMAGEVIEW_H__
#include "gui/UIWidget.h"
#include "ui/UIWidget.h"
NS_CC_BEGIN

View File

@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "gui/UILayout.h"
#include "gui/UIHelper.h"
#include "ui/UILayout.h"
#include "ui/UIHelper.h"
#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h"
#include "kazmath/GL/matrix.h"
#include "CCGLProgram.h"

Some files were not shown because too many files have changed in this diff Show More