add spritetest lua test case

This commit is contained in:
wangshuai 2013-03-11 13:49:09 +08:00
parent b06380432b
commit 78d5c480b7
4 changed files with 1260 additions and 62 deletions

File diff suppressed because it is too large Load Diff

View File

@ -59,3 +59,20 @@ function class(classname, super)
return cls return cls
end end
function schedule(node, callback, delay)
local delay = CCDelayTime:create(delay)
local callfunc = CCCallFunc:create(callback)
local sequence = CCSequence:createWithTwoActions(delay, callfunc)
local action = CCRepeatForever:create(sequence)
node:runAction(action)
return action
end
function performWithDelay(node, callback, delay)
local delay = CCDelayTime:create(delay)
local callfunc = CCCallFunc:create(callback)
local sequence = CCSequence:createWithTwoActions(delay, callfunc)
node:runAction(sequence)
return sequence
end

View File

@ -68,6 +68,7 @@ local function CreateTestScene(nIdx)
elseif nIdx == Test_Table.TEST_TEXT_INPUT then elseif nIdx == Test_Table.TEST_TEXT_INPUT then
elseif nIdx == Test_Table.TEST_SPRITE then elseif nIdx == Test_Table.TEST_SPRITE then
scene = SpriteTest()
elseif nIdx == Test_Table.TEST_SCHEDULER then elseif nIdx == Test_Table.TEST_SCHEDULER then

View File

@ -12,6 +12,7 @@ require "luaScript/MotionStreakTest/MotionStreakTest"
require "luaScript/DrawPrimitivesTest/DrawPrimitivesTest" require "luaScript/DrawPrimitivesTest/DrawPrimitivesTest"
require "luaScript/NodeTest/NodeTest" require "luaScript/NodeTest/NodeTest"
require "luaScript/TouchesTest/TouchesTest" require "luaScript/TouchesTest/TouchesTest"
require "luaScript/SpriteTest/SpriteTest"
require "luaScript/PerformanceTest/PerformanceTest" require "luaScript/PerformanceTest/PerformanceTest"
@ -29,40 +30,40 @@ Test_Table =
"TEST_PARTICLE", "TEST_PARTICLE",
"TEST_EASE_ACTIONS", "TEST_EASE_ACTIONS",
"TEST_MOTION_STREAK", "TEST_MOTION_STREAK",
"TEST_DRAW_PRIMITIVES", -- "TEST_DRAW_PRIMITIVES",
"TEST_COCOSNODE", "TEST_COCOSNODE",
"TEST_TOUCHES", "TEST_TOUCHES",
"TEST_MENU", -- "TEST_MENU",
"TEST_ACTION_MANAGER", -- "TEST_ACTION_MANAGER",
"TEST_LAYER", -- "TEST_LAYER",
"TEST_SCENE", -- "TEST_SCENE",
"TEST_PARALLAX", -- "TEST_PARALLAX",
"TEST_TILE_MAP", -- "TEST_TILE_MAP",
"TEST_INTERVAL", -- "TEST_INTERVAL",
"TEST_CHIPMUNKACCELTOUCH", -- "TEST_CHIPMUNKACCELTOUCH",
"TEST_LABEL", -- "TEST_LABEL",
"TEST_TEXT_INPUT", -- "TEST_TEXT_INPUT",
"TEST_SPRITE", "TEST_SPRITE",
"TEST_SCHEDULER", -- "TEST_SCHEDULER",
"TEST_RENDERTEXTURE", -- "TEST_RENDERTEXTURE",
"TEST_TEXTURE2D", -- "TEST_TEXTURE2D",
"TEST_BOX2D", -- "TEST_BOX2D",
"TEST_BOX2DBED", -- "TEST_BOX2DBED",
"TEST_EFFECT_ADVANCE", -- "TEST_EFFECT_ADVANCE",
"TEST_ACCELEROMRTER", -- "TEST_ACCELEROMRTER",
"TEST_KEYPAD", -- "TEST_KEYPAD",
"TEST_COCOSDENSHION", -- "TEST_COCOSDENSHION",
"TEST_PERFORMANCE", -- "TEST_PERFORMANCE",
"TEST_ZWOPTEX", -- "TEST_ZWOPTEX",
"TEST_CURL", -- "TEST_CURL",
"TEST_USERDEFAULT", -- "TEST_USERDEFAULT",
"TEST_BUGS", -- "TEST_BUGS",
"TEST_FONTS", -- "TEST_FONTS",
"TEST_CURRENT_LANGUAGE", -- "TEST_CURRENT_LANGUAGE",
"TEST_TEXTURECACHE", -- "TEST_TEXTURECACHE",
"TEST_EXTENSIONS", -- "TEST_EXTENSIONS",
"TEST_SHADER", -- "TEST_SHADER",
"TEST_MUTITOUCH", -- "TEST_MUTITOUCH",
"TESTS_COUNT" "TESTS_COUNT"
} }
@ -79,38 +80,38 @@ Test_Name =
"ParticleTest", "ParticleTest",
"ActionsEaseTest", "ActionsEaseTest",
"MotionStreakTest", "MotionStreakTest",
"DrawPrimitivesTest", -- "DrawPrimitivesTest",
"NodeTest", "NodeTest",
"TouchesTest", "TouchesTest",
"MenuTest", -- "MenuTest",
"ActionManagerTest", -- "ActionManagerTest",
"LayerTest", -- "LayerTest",
"SceneTest", -- "SceneTest",
"ParallaxTest", -- "ParallaxTest",
"TileMapTest", -- "TileMapTest",
"IntervalTest", -- "IntervalTest",
"ChipmunkAccelTouchTest", -- "ChipmunkAccelTouchTest",
"LabelTest", -- "LabelTest",
"TextInputTest", -- "TextInputTest",
"SpriteTest", "SpriteTest",
"SchdulerTest", -- "SchdulerTest",
"RenderTextureTest", -- "RenderTextureTest",
"Texture2DTest", -- "Texture2DTest",
"Box2dTest", -- "Box2dTest",
"Box2dTestBed", -- "Box2dTestBed",
"EffectAdvancedTest", -- "EffectAdvancedTest",
"Accelerometer", -- "Accelerometer",
"KeypadTest", -- "KeypadTest",
"CocosDenshionTest", -- "CocosDenshionTest",
"PerformanceTest", -- "PerformanceTest",
"ZwoptexTest", -- "ZwoptexTest",
"CurlTest", -- "CurlTest",
"UserDefaultTest", -- "UserDefaultTest",
"BugsTest", -- "BugsTest",
"FontTest", -- "FontTest",
"CurrentLanguageTest", -- "CurrentLanguageTest",
"TextureCacheTest", -- "TextureCacheTest",
"ExtensionsTest", -- "ExtensionsTest",
"ShaderTest", -- "ShaderTest",
"MutiTouchTest" -- "MutiTouchTest"
} }