Skip to content

Commit c80b249

Browse files
committed
refactor due to rename
1 parent a792fa4 commit c80b249

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

10.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Chapter 11: Lua
1+
# Chapter 10: Lua
22

33
## Call custom c++ from Lua
44
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
891891
### Basic Settings
892892
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` :
893893

894-
![](11/lua_cocos_preferences.png)
894+
![](10/lua_cocos_preferences.png)
895895

896896
### Additional Settings
897897
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:
898898

899-
![](11/cocos_preferences.png)
899+
![](10/cocos_preferences.png)
900900

901901
## Debug a Lua Game
902902
1. Create a new Cococs Lua Project by the right click menu in the `Lua Projects Explorer`
903903

904-
![](11/lua_create_project.png)
904+
![](10/lua_create_project.png)
905905

906906
2. Select `src/GameScene.lua` and open it,then toggle breakpoint by right click menu or double click
907907

908-
![](11/lua_toggle_breakpoint.png)
908+
![](10/lua_toggle_breakpoint.png)
909909

910910
3.Click debug button on toolbar
911911

912-
![](11/lua_debug_button.png)
912+
![](10/lua_debug_button.png)
913913

914914
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.
915915

916-
![](11/lua_confirm_perspective.png)
917-
![](11/lua_debug_dialog.png)
916+
![](10/lua_confirm_perspective.png)
917+
![](10/lua_debug_dialog.png)
918918

919919
5.Use `Step over`, `Step into`, `Step out` in the tool bar to debug
920920

921-
![](11/lua_step_debug.png)
921+
![](10/lua_step_debug.png)
922922

923923
## Code Hot Updating when Debugging
924924
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
947947

948948
1. Click `Debug Configurations` button on the toolbar to open `Debug Configurations` dialog
949949

950-
![](11/lua_config_button.png)
950+
![](10/lua_config_button.png)
951951

952952
2. Select the `CocosLuaGame` item,then to configure
953-
![](11/lua_debug_configure_dialog.png)
953+
![](10/lua_debug_configure_dialog.png)
954954

955955
### Debug on the iOS Simulator
956956
1. Check iOS Simulator radio button
@@ -959,46 +959,46 @@ The above example is executed on the Mac platform because of the default configu
959959

960960
3. Click the Debug button,IDE will auto-install chosen runtime app and start runtime to debug
961961

962-
![](11/lua_configure_iOS_simulator.png)
962+
![](10/lua_configure_iOS_simulator.png)
963963

964964
### Debug on the iOS Device
965965

966966
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.
967967

968968
- Click `Build Runtime` on the toolbars
969969

970-
![](11/lua_configure_build_runtime.png)
970+
![](10/lua_configure_build_runtime.png)
971971

972972
- Click `Yes` button on the pop-up `Cocos` dialog
973973

974-
![](11/lua_configure_build_runtime_first.png)
974+
![](10/lua_configure_build_runtime_first.png)
975975

976976
- Click `Generate` button to Generate `Create Native Source Wizard`
977977

978-
![](11/lua_configure_creat_native_source_wizard.png)
978+
![](10/lua_configure_creat_native_source_wizard.png)
979979

980980
- Click `Close` button to finish `Create Native Source Wizard`
981981

982-
![](11/lua_configure_finish_create_native_source_wizard.png)
982+
![](10/lua_configure_finish_create_native_source_wizard.png)
983983

984984
- Click `Build Runtime` on the toolbars to open `Runtime Builder Wizard` dialog
985985

986-
![](11/lua_configure_runtime_builder_wizard.png)
986+
![](10/lua_configure_runtime_builder_wizard.png)
987987

988988
- Check `Build iOS Device Runtime` and click `Generate` button to generate
989989

990-
![](11/lua_configure_runtime_select_iOS_device.png)
990+
![](10/lua_configure_runtime_select_iOS_device.png)
991991

992992
- Click `Close` button when Finished dialog pop up
993993

994-
![](11/lua_configure_finish_iOS_device.png)
994+
![](10/lua_configure_finish_iOS_device.png)
995995

996996
2. Click `Debug Configuration`,then check `Remote Debug` radio button on the `Debug Configuration` dialog
997997
3. Select `iOS` platform
998998
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)
999999
5. Click 'Debug' button to begin to debug
10001000

1001-
![](11/lua_iOS_device_remote_setting.png)
1001+
![](10/lua_iOS_device_remote_setting.png)
10021002

10031003
### Debug on the Android Device by ADB Mode
10041004
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
10071007
4. Click the `Debug` button
10081008
5. IDE will auto-install the chosen runtime apk and start to debug
10091009

1010-
![](11/lua_debug_android_adb_mode.png)
1010+
![](10/lua_debug_android_adb_mode.png)
10111011

10121012

10131013
### 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
10181018
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)
10191019
5. Click 'Debug' button to begin to debug
10201020

1021-
![](11/lua_anroid_device_remote_setting.png)
1021+
![](10/lua_anroid_device_remote_setting.png)
10221022

10231023

0 commit comments

Comments
 (0)