You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: 10.md
+22-22
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Chapter 11: Lua
1
+
# Chapter 10: Lua
2
2
3
3
## Call custom c++ from Lua
4
4
cocos2d-x lua binds c++ class, class functions ,enum and some global functions to lua through auto-binding by bindings-generator(tools/bindings-generator) and some manual binding,so we can call custom c++ from lua conveniently.
@@ -891,34 +891,34 @@ If you have been not installed the Cocos Code IDE,you can refer to [Cocos Code I
891
891
### Basic Settings
892
892
Click `Cocos Code IDE/Preferences` to open the congiuration dialog,then select the `Cocos/Lua` to set the directory of cocos2d-x v3.x in the `Lua Frameworks` :
893
893
894
-

894
+

895
895
896
896
### Additional Settings
897
897
You should set directory of some compliling tools about android if you need to replace the Android runtime which Cocos Code IDE provided.Click `Cocos Code IDE/Preferences` then pitch on `Cocos` to configurate the directory of related tools:
898
898
899
-

899
+

900
900
901
901
## Debug a Lua Game
902
902
1. Create a new Cococs Lua Project by the right click menu in the `Lua Projects Explorer`
903
903
904
-

904
+

905
905
906
906
2. Select `src/GameScene.lua` and open it,then toggle breakpoint by right click menu or double click
907
907
908
-

908
+

909
909
910
910
3.Click debug button on toolbar
911
911
912
-

912
+

913
913
914
914
4.Trigger the breakpoint,select "Yes" to open `Debug Perspective`,and you will find many useful debug views like `Call stacks`, `Variables` and `Breakpoints`,etc.
915
915
916
-

917
-

916
+

917
+

918
918
919
919
5.Use `Step over`, `Step into`, `Step out` in the tool bar to debug
920
920
921
-

921
+

922
922
923
923
## Code Hot Updating when Debugging
924
924
We could realize the hot updating of lua code when debugging by the Cocos Code IDE.
@@ -947,10 +947,10 @@ The above example is executed on the Mac platform because of the default configu
947
947
948
948
1. Click `Debug Configurations` button on the toolbar to open `Debug Configurations` dialog
949
949
950
-

950
+

951
951
952
952
2. Select the `CocosLuaGame` item,then to configure
953
-

953
+

954
954
955
955
### Debug on the iOS Simulator
956
956
1. Check iOS Simulator radio button
@@ -959,46 +959,46 @@ The above example is executed on the Mac platform because of the default configu
959
959
960
960
3. Click the Debug button,IDE will auto-install chosen runtime app and start runtime to debug
961
961
962
-

962
+

963
963
964
964
### Debug on the iOS Device
965
965
966
966
1.You need a runtime IPA, you can build a custom runtime IPA by Cocos Code IDE, then [install runtime IPA](http://www.solutionanalysts.com/blog/how-install-ipa-file-iphone-ipod-ipad-using-itunes-mac-windows) to iOS device.
967
967
968
968
- Click `Build Runtime` on the toolbars
969
969
970
-

970
+

971
971
972
972
- Click `Yes` button on the pop-up `Cocos` dialog
973
973
974
-

974
+

975
975
976
976
- Click `Generate` button to Generate `Create Native Source Wizard`
- Click `Close` button when Finished dialog pop up
993
993
994
-

994
+

995
995
996
996
2. Click `Debug Configuration`,then check `Remote Debug` radio button on the `Debug Configuration` dialog
997
997
3. Select `iOS` platform
998
998
4. Fill IP address of your device into the `Target IP` and Fill the IP address that your PC used on the `Host IP`(Make sure that the `Target IP` and `Host IP` can access each other)
999
999
5. Click 'Debug' button to begin to debug
1000
1000
1001
-

1001
+

1002
1002
1003
1003
### Debug on the Android Device by ADB Mode
1004
1004
1. Prebuild Runtimelua.apk by `Build Runtime` like first of `Debug on the iOS Device`
@@ -1007,7 +1007,7 @@ The above example is executed on the Mac platform because of the default configu
1007
1007
4. Click the `Debug` button
1008
1008
5. IDE will auto-install the chosen runtime apk and start to debug
1009
1009
1010
-

1010
+

1011
1011
1012
1012
1013
1013
### Debug on the Android Deveice by WLAN
@@ -1018,6 +1018,6 @@ The above example is executed on the Mac platform because of the default configu
1018
1018
4. Fill IP address of your device into the `Target IP` and Fill the IP address that your PC used on the `Host IP`(Make sure that the `Target IP` and `Host IP` can access each other)
0 commit comments