mirror of https://github.com/axmolengine/axmol.git
issue #2276: Add scrollview sample test in cocosbuilder and modify some config
This commit is contained in:
parent
71fe43ee97
commit
c527fecfe3
|
@ -49,6 +49,12 @@ ccb["TestTimelineLayer"] = TestTimelineLayer
|
|||
TestTimelineLayerOwner = TestTimelineLayerOwner or {}
|
||||
ccb["TestTimelineLayerOwner"] = TestTimelineLayerOwner
|
||||
|
||||
TestScrollViewsLayer = TestScrollViewsLayer or {}
|
||||
ccb["TestScrollViewsLayer"] = TestScrollViewsLayer
|
||||
|
||||
TestScrollViewsLayerOwner = TestScrollViewsLayerOwner or {}
|
||||
ccb["TestScrollViewsLayerOwner"] = TestScrollViewsLayerOwner
|
||||
|
||||
local function onMenuItemAClicked()
|
||||
if nil ~= TestMenusLayer["mMenuItemStatusLabelBMFont"] then
|
||||
local labelBmFt = tolua.cast(TestMenusLayer["mMenuItemStatusLabelBMFont"],"CCLabelBMFont")
|
||||
|
@ -231,7 +237,21 @@ TestAnimationsLayer["onCCControlButtonFunkyClicked"] = onCCControlButtonFunkyCli
|
|||
|
||||
|
||||
local function onScrollViewTestClicked()
|
||||
print("onScrollViewTestClicked")
|
||||
local scene = CCScene:create()
|
||||
local proxy = CCBProxy:create()
|
||||
local node = CCBReaderLoad("cocosbuilderRes/ccb/ccb/TestScrollViews.ccbi",proxy,true,"TestScrollViewsLayerOwner")
|
||||
local layer = tolua.cast(node,"CCLayer")
|
||||
if nil ~= TestScrollViewsLayerOwner["mTestTitleLabelTTF"] then
|
||||
local ccLabelTTF = tolua.cast(TestScrollViewsLayerOwner["mTestTitleLabelTTF"],"CCLabelTTF")
|
||||
if nil ~= ccLabelTTF then
|
||||
ccLabelTTF:setString("ccb/ccb/TestScrollViews.ccbi")
|
||||
end
|
||||
end
|
||||
if nil ~= scene then
|
||||
scene:addChild(layer)
|
||||
scene:addChild(CreateBackMenuItem())
|
||||
CCDirector:sharedDirector():pushScene(CCTransitionFade:create(0.5, scene, ccc3(0,0,0)));
|
||||
end
|
||||
end
|
||||
|
||||
local function onTimelineCallbackSoundClicked()
|
||||
|
|
|
@ -1019,7 +1019,7 @@ local function runScrollViewTest()
|
|||
print("scrollView1DidZoom")
|
||||
end
|
||||
if nil ~= scrollView1 then
|
||||
scrollView1:setViewSize(CCSizeMake(240,320))
|
||||
scrollView1:setViewSize(CCSizeMake(screenSize.width / 2,screenSize.height))
|
||||
scrollView1:setPosition(CCPointMake(0,0))
|
||||
scrollView1:setScale(1.0)
|
||||
scrollView1:ignoreAnchorPointForPosition(true)
|
||||
|
@ -1028,7 +1028,7 @@ local function runScrollViewTest()
|
|||
scrollView1:setContainer(flowersprite1)
|
||||
scrollView1:updateInset()
|
||||
end
|
||||
scrollView1:setDirection(kCCScrollViewDirectionBoth)
|
||||
scrollView1:setDirection(kScrollViewDirectionBoth)
|
||||
scrollView1:setClippingToBounds(true)
|
||||
scrollView1:setBounceable(true)
|
||||
scrollView1:setDelegate()
|
||||
|
@ -1045,7 +1045,7 @@ local function runScrollViewTest()
|
|||
print("scrollView2DidZoom")
|
||||
end
|
||||
if nil ~= scrollView2 then
|
||||
scrollView2:setViewSize(CCSizeMake(240,320))
|
||||
scrollView2:setViewSize(CCSizeMake(screenSize.width / 2,screenSize.height))
|
||||
scrollView2:setPosition(CCPointMake(screenSize.width / 2,0))
|
||||
scrollView2:setScale(1.0)
|
||||
scrollView2:ignoreAnchorPointForPosition(true)
|
||||
|
@ -1054,7 +1054,7 @@ local function runScrollViewTest()
|
|||
scrollView2:setContainer(flowersprite2)
|
||||
scrollView2:updateInset()
|
||||
end
|
||||
scrollView2:setDirection(kCCScrollViewDirectionBoth)
|
||||
scrollView2:setDirection(kScrollViewDirectionBoth)
|
||||
scrollView2:setClippingToBounds(true)
|
||||
scrollView2:setBounceable(true)
|
||||
scrollView2:setDelegate()
|
||||
|
|
|
@ -15,6 +15,7 @@ LOCAL_SRC_FILES := ../cocos2dx_support/CCLuaBridge.cpp \
|
|||
../cocos2dx_support/Lua_extensions_CCB.cpp \
|
||||
../cocos2dx_support/Lua_web_socket.cpp \
|
||||
../cocos2dx_support/LuaOpengl.cpp \
|
||||
../cocos2dx_support/LuaScrollView.cpp \
|
||||
../tolua/tolua_event.c \
|
||||
../tolua/tolua_is.c \
|
||||
../tolua/tolua_map.c \
|
||||
|
|
|
@ -47,7 +47,8 @@ SOURCES = ../lua/lapi.o \
|
|||
../cocos2dx_support/LuaCocos2d.cpp \
|
||||
../cocos2dx_support/CCBProxy.cpp \
|
||||
../cocos2dx_support/Lua_extensions_CCB.cpp \
|
||||
../cocos2dx_support/LuaOpengl.cpp
|
||||
../cocos2dx_support/LuaOpengl.cpp \
|
||||
../cocos2dx_support/LuaScrollView.cpp
|
||||
|
||||
include ../../../cocos2dx/proj.emscripten/cocos2dx.mk
|
||||
|
||||
|
|
|
@ -47,7 +47,8 @@ SOURCES = ../lua/lapi.o \
|
|||
../cocos2dx_support/LuaCocos2d.cpp \
|
||||
../cocos2dx_support/CCBProxy.cpp \
|
||||
../cocos2dx_support/Lua_extensions_CCB.cpp \
|
||||
../cocos2dx_support/LuaOpengl.cpp
|
||||
../cocos2dx_support/LuaOpengl.cpp \
|
||||
../cocos2dx_support/LuaScrollView.cpp
|
||||
|
||||
include ../../../cocos2dx/proj.linux/cocos2dx.mk
|
||||
|
||||
|
|
|
@ -40,4 +40,6 @@ files
|
|||
"tolua_fix.h"
|
||||
"LuaOpengl.cpp"
|
||||
"LuaOpengl.h"
|
||||
"LuaScrollView.cpp"
|
||||
"LuaScrollView.h"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue