From 062fb859430695fae6d4734af3495bd6a434e459 Mon Sep 17 00:00:00 2001 From: samuele3 Date: Wed, 13 Nov 2013 10:12:44 +0800 Subject: [PATCH] issue #2868:Modify cocos2dx_studio.ini to add more auto-binding class --- .../cocostudio/CSContentJsonDictionary.h | 2 +- .../CocoStudioSceneTest/CocoStudioSceneTest.lua | 15 +-------------- tools/tolua/cocos2dx_studio.ini | 6 ++++-- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/cocos/editor-support/cocostudio/CSContentJsonDictionary.h b/cocos/editor-support/cocostudio/CSContentJsonDictionary.h index f8f047b19a..cca9ba5ad8 100644 --- a/cocos/editor-support/cocostudio/CSContentJsonDictionary.h +++ b/cocos/editor-support/cocostudio/CSContentJsonDictionary.h @@ -50,7 +50,7 @@ namespace cocostudio { { public: JsonDictionary(); - ~JsonDictionary(); + virtual ~JsonDictionary(); public: void initWithDescription(const char *pszDescription); diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua index 2b7fd6905d..a1679ee671 100644 --- a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua @@ -11,19 +11,6 @@ function SceneEditorTestLayer.extend(target) return target end -function SceneEditorTestLayer:init() - - - local mainMenuLabel = ccs.UILabel:create() - mainMenuLabel:setText("MainMenu") - mainMenuLabel:setFontSize(20) - mainMenuLabel:setTouchScaleChangeEnabled(true) - mainMenuLabel:setPosition(cc.p(430,30)) - mainMenuLabel:setTouchEnabled(true) - mainMenuLabel:addTouchEventListener(menuCloseCallback) - self._uiLayer:addWidget(mainMenuLabel) -end - function SceneEditorTestLayer:createGameScene() local node = ccs.SceneReader:getInstance():createNodeWithSceneFile("scenetest/FishJoy2.json") if nil == node then @@ -44,7 +31,7 @@ function SceneEditorTestLayer:createGameScene() cc.MenuItemFont:setFontSize(24) local itemBack = cc.MenuItemFont:create("Back") itemBack:setColor(cc.c3b(255, 255, 255)) - itemBack:setPosition(cc.p(VisibleRect:bottom().x - 50, VisibleRect:bottom().y + 25)) + itemBack:setPosition( cc.p(430,30) ) itemBack:registerScriptTapHandler(menuCloseCallback) local menuBack = cc.Menu:create() menuBack:setPosition(cc.p(0.0, 0.0)) diff --git a/tools/tolua/cocos2dx_studio.ini b/tools/tolua/cocos2dx_studio.ini index 734bf0f02b..3aed09bac4 100644 --- a/tools/tolua/cocos2dx_studio.ini +++ b/tools/tolua/cocos2dx_studio.ini @@ -27,7 +27,7 @@ headers = %(cocosdir)s/cocos/gui/CocosGUI.h %(cocosdir)s/cocos/editor-support/co # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = Armature ArmatureAnimation Skin Bone ArmatureDataManager \w+Data$ UIWidget UILayout UIRootWidget UIButton UICheckBox UIImageView UILabel UICCLabelAtlas UILabelAtlas UILoadingBar UIScrollView UISlider UICCTextField UITextField UIListView UILabelBMFont UIPageView UIHelper UILayer UILayoutParameter GUIReader UILinearLayoutParameter UIRelativeLayoutParameter SceneReader ActionManagerEx ComAudio +classes = Armature ArmatureAnimation Skin Bone ArmatureDataManager \w+Data$ UIWidget UILayout UIRootWidget UIButton UICheckBox UIImageView UILabel UICCLabelAtlas UILabelAtlas UILoadingBar UIScrollView UISlider UICCTextField UITextField UIListView UILabelBMFont UIPageView UIHelper UILayer UILayoutParameter GUIReader UILinearLayoutParameter UIRelativeLayoutParameter SceneReader ActionManagerEx ComAudio ComController ComAttribute ComRender # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -45,7 +45,9 @@ skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .* UILayer::[getInputManager], UILayoutParameter::[(s|g)etMargin], UIHelper::[init], - GUIReader::[setPropsForImageButtonFromJsonDictionary] + GUIReader::[setPropsForImageButtonFromJsonDictionary], + UIWidget::[(s|g)etUserObject], + UIImageView::[doubleClickEvent] rename_functions = UIHelper::[instance=getInstance], ArmatureDataManager::[sharedArmatureDataManager=getInstance],