Skip to content

Commit b91ef30

Browse files
committed
Merge branch 'develop' into effects
2 parents b1e5105 + c693a92 commit b91ef30

File tree

28 files changed

+598
-102
lines changed

28 files changed

+598
-102
lines changed

.gitmodules

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
[submodule "external/Chipmunk"]
22
path = external/Chipmunk
33
url=https://github.com/slembcke/Chipmunk2D.git
4+
[submodule "external/ogg"]
5+
path = external/ogg
6+
url = [email protected]:apportable/ogg.git
7+
branch = apportable
8+
[submodule "external/tremor"]
9+
path = external/tremor
10+
url = [email protected]:apportable/tremor.git
11+
branch = apportable

Resources/Sounds/sound.ogg

5.95 KB
Binary file not shown.

cocos2d-ios.xcodeproj/project.pbxproj

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
571CD02B19649E03003D460C /* CCPlatformTextFieldIOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 571CD02219649E03003D460C /* CCPlatformTextFieldIOS.m */; };
106106
57202D391970776100238D56 /* CCPlatformTextFieldAndroid.m in Sources */ = {isa = PBXBuildFile; fileRef = 571CD01D19649E03003D460C /* CCPlatformTextFieldAndroid.m */; };
107107
577D72D11970AC59005ABDC0 /* CCPlatformTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 571CD01F19649E03003D460C /* CCPlatformTextField.m */; };
108+
57BFF2B61991931300A3FE9C /* CCEditText.java in Sources */ = {isa = PBXBuildFile; fileRef = 57BFF2B51991931300A3FE9C /* CCEditText.java */; };
109+
57BFF2BA1991937C00A3FE9C /* CCEditText.m in Sources */ = {isa = PBXBuildFile; fileRef = 57BFF2B81991937C00A3FE9C /* CCEditText.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
108110
5B063DCC19637285002B1CDE /* ALWeakArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B063DCA19637285002B1CDE /* ALWeakArray.h */; };
109111
5B063DCD19637285002B1CDE /* ALWeakArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B063DCB19637285002B1CDE /* ALWeakArray.m */; };
110112
5B063DD019637291002B1CDE /* ALWeakDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B063DCE19637291002B1CDE /* ALWeakDictionary.h */; };
@@ -686,6 +688,7 @@
686688
E0F924711224140400EF2362 /* CCTexturePVR.h in Headers */ = {isa = PBXBuildFile; fileRef = E0F9246F1224140400EF2362 /* CCTexturePVR.h */; };
687689
E0F924721224140400EF2362 /* CCTexturePVR.m in Sources */ = {isa = PBXBuildFile; fileRef = E0F924701224140400EF2362 /* CCTexturePVR.m */; };
688690
E0F92AC41224559800EF2362 /* CCNS.h in Headers */ = {isa = PBXBuildFile; fileRef = E0F92AC31224559800EF2362 /* CCNS.h */; };
691+
FC55599E1991A26000E29CCE /* libtremor.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FC55599B1991A25000E29CCE /* libtremor.a */; };
689692
/* End PBXBuildFile section */
690693

691694
/* Begin PBXContainerItemProxy section */
@@ -710,6 +713,20 @@
710713
remoteGlobalIDString = D309B21217EFE2EF00AA52C8;
711714
remoteInfo = "ObjectiveChipmunk-iPhone";
712715
};
716+
FC55599A1991A25000E29CCE /* PBXContainerItemProxy */ = {
717+
isa = PBXContainerItemProxy;
718+
containerPortal = FC5559951991A25000E29CCE /* tremor.xcodeproj */;
719+
proxyType = 2;
720+
remoteGlobalIDString = FC76226219919ECD0001BCF4;
721+
remoteInfo = tremor;
722+
};
723+
FC55599C1991A25A00E29CCE /* PBXContainerItemProxy */ = {
724+
isa = PBXContainerItemProxy;
725+
containerPortal = FC5559951991A25000E29CCE /* tremor.xcodeproj */;
726+
proxyType = 1;
727+
remoteGlobalIDString = FC76226119919ECD0001BCF4;
728+
remoteInfo = tremor;
729+
};
713730
/* End PBXContainerItemProxy section */
714731

715732
/* Begin PBXCopyFilesBuildPhase section */
@@ -830,6 +847,9 @@
830847
571CD02219649E03003D460C /* CCPlatformTextFieldIOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPlatformTextFieldIOS.m; sourceTree = "<group>"; };
831848
571CD02419649E03003D460C /* CCPlatformTextFieldMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPlatformTextFieldMac.h; sourceTree = "<group>"; };
832849
571CD02519649E03003D460C /* CCPlatformTextFieldMac.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPlatformTextFieldMac.m; sourceTree = "<group>"; };
850+
57BFF2B51991931300A3FE9C /* CCEditText.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; name = CCEditText.java; path = java/org/cocos2d/CCEditText.java; sourceTree = "<group>"; };
851+
57BFF2B71991937C00A3FE9C /* CCEditText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEditText.h; path = java/CCEditText.h; sourceTree = "<group>"; };
852+
57BFF2B81991937C00A3FE9C /* CCEditText.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CCEditText.m; path = java/CCEditText.m; sourceTree = "<group>"; };
833853
5B063DCA19637285002B1CDE /* ALWeakArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALWeakArray.h; sourceTree = "<group>"; };
834854
5B063DCB19637285002B1CDE /* ALWeakArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ALWeakArray.m; sourceTree = "<group>"; };
835855
5B063DCE19637291002B1CDE /* ALWeakDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALWeakDictionary.h; sourceTree = "<group>"; };
@@ -1109,6 +1129,8 @@
11091129
E0F9246F1224140400EF2362 /* CCTexturePVR.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTexturePVR.h; sourceTree = "<group>"; };
11101130
E0F924701224140400EF2362 /* CCTexturePVR.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTexturePVR.m; sourceTree = "<group>"; };
11111131
E0F92AC31224559800EF2362 /* CCNS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNS.h; sourceTree = "<group>"; };
1132+
FC5559951991A25000E29CCE /* tremor.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = tremor.xcodeproj; path = external/tremor/android/tremor/tremor.xcodeproj; sourceTree = "<group>"; };
1133+
FC55599F1991A26300E29CCE /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = "external/ogg/android/ogg/build/Debug-android/libogg.a"; sourceTree = "<group>"; };
11121134
/* End PBXFileReference section */
11131135

11141136
/* Begin PBXFrameworksBuildPhase section */
@@ -1143,6 +1165,7 @@
11431165
isa = PBXFrameworksBuildPhase;
11441166
buildActionMask = 2147483647;
11451167
files = (
1168+
FC55599E1991A26000E29CCE /* libtremor.a in Frameworks */,
11461169
D291DCC2195B2FA100278EC0 /* libObjectiveChipmunk-iPhone.a in Frameworks */,
11471170
D2FEB745194F6C9E00FC0574 /* CoreText.framework in Frameworks */,
11481171
D2FEB747194F6C9E00FC0574 /* Foundation.framework in Frameworks */,
@@ -1188,6 +1211,7 @@
11881211
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
11891212
isa = PBXGroup;
11901213
children = (
1214+
FC55599F1991A26300E29CCE /* libogg.a */,
11911215
D3903B1919952ABD003AA81A /* Metal.framework */,
11921216
D24FAEEB198014B90043E27D /* GLKit.framework */,
11931217
D289C1C1197440BC00B68E3D /* BridgeKitV3.framework */,
@@ -1209,6 +1233,7 @@
12091233
501756090F335CE900624901 /* external */ = {
12101234
isa = PBXGroup;
12111235
children = (
1236+
FC5559951991A25000E29CCE /* tremor.xcodeproj */,
12121237
B759E5281880C66900E8166C /* Chipmunk7-ios.xcodeproj */,
12131238
B7705F8A1831A07B0043CC67 /* ObjectAL */,
12141239
);
@@ -1482,6 +1507,9 @@
14821507
children = (
14831508
571CD01C19649E03003D460C /* CCPlatformTextFieldAndroid.h */,
14841509
571CD01D19649E03003D460C /* CCPlatformTextFieldAndroid.m */,
1510+
57BFF2B51991931300A3FE9C /* CCEditText.java */,
1511+
57BFF2B71991937C00A3FE9C /* CCEditText.h */,
1512+
57BFF2B81991937C00A3FE9C /* CCEditText.m */,
14851513
);
14861514
path = Android;
14871515
sourceTree = "<group>";
@@ -1907,6 +1935,14 @@
19071935
path = iOS;
19081936
sourceTree = "<group>";
19091937
};
1938+
FC5559961991A25000E29CCE /* Products */ = {
1939+
isa = PBXGroup;
1940+
children = (
1941+
FC55599B1991A25000E29CCE /* libtremor.a */,
1942+
);
1943+
name = Products;
1944+
sourceTree = "<group>";
1945+
};
19101946
/* End PBXGroup section */
19111947

19121948
/* Begin PBXHeadersBuildPhase section */
@@ -2324,12 +2360,13 @@
23242360
buildConfigurationList = D2FEB74C194F6C9E00FC0574 /* Build configuration list for PBXNativeTarget "cocos2dAndroid" */;
23252361
buildPhases = (
23262362
D2FEB610194F6C9E00FC0574 /* Headers */,
2327-
D2FEB6B8194F6C9E00FC0574 /* Sources */,
23282363
D2FEB740194F6C9E00FC0574 /* Frameworks */,
2364+
D2FEB6B8194F6C9E00FC0574 /* Sources */,
23292365
);
23302366
buildRules = (
23312367
);
23322368
dependencies = (
2369+
FC55599D1991A25A00E29CCE /* PBXTargetDependency */,
23332370
D2FEB60E194F6C9E00FC0574 /* PBXTargetDependency */,
23342371
);
23352372
name = cocos2dAndroid;
@@ -2363,6 +2400,10 @@
23632400
ProductGroup = B759E5291880C66900E8166C /* Products */;
23642401
ProjectRef = B759E5281880C66900E8166C /* Chipmunk7-ios.xcodeproj */;
23652402
},
2403+
{
2404+
ProductGroup = FC5559961991A25000E29CCE /* Products */;
2405+
ProjectRef = FC5559951991A25000E29CCE /* tremor.xcodeproj */;
2406+
},
23662407
);
23672408
projectRoot = "";
23682409
targets = (
@@ -2382,6 +2423,13 @@
23822423
remoteRef = B759E52C1880C66900E8166C /* PBXContainerItemProxy */;
23832424
sourceTree = BUILT_PRODUCTS_DIR;
23842425
};
2426+
FC55599B1991A25000E29CCE /* libtremor.a */ = {
2427+
isa = PBXReferenceProxy;
2428+
fileType = archive.ar;
2429+
path = libtremor.a;
2430+
remoteRef = FC55599A1991A25000E29CCE /* PBXContainerItemProxy */;
2431+
sourceTree = BUILT_PRODUCTS_DIR;
2432+
};
23852433
/* End PBXReferenceProxy section */
23862434

23872435
/* Begin PBXResourcesBuildPhase section */
@@ -2567,6 +2615,7 @@
25672615
isa = PBXSourcesBuildPhase;
25682616
buildActionMask = 2147483647;
25692617
files = (
2618+
57BFF2B61991931300A3FE9C /* CCEditText.java in Sources */,
25702619
5BC3CB5C1962795500C4F0D0 /* CCGestureListener.java in Sources */,
25712620
5BF3268E195F8E0300D9A51A /* CCActivity.java in Sources */,
25722621
5BF3268F195F8E0300D9A51A /* CCGLView.java in Sources */,
@@ -2604,6 +2653,7 @@
26042653
D2FEB6D0194F6C9E00FC0574 /* TGAlib.m in Sources */,
26052654
D2FEB6D1194F6C9E00FC0574 /* CCTextField.m in Sources */,
26062655
D2FEB6D2194F6C9E00FC0574 /* CCActionEase.m in Sources */,
2656+
57BFF2BA1991937C00A3FE9C /* CCEditText.m in Sources */,
26072657
D2FEB6D3194F6C9E00FC0574 /* CCPhysicsShape.m in Sources */,
26082658
577D72D11970AC59005ABDC0 /* CCPlatformTextField.m in Sources */,
26092659
D2FEB6D4194F6C9E00FC0574 /* ALContext.m in Sources */,
@@ -2738,6 +2788,11 @@
27382788
name = "ObjectiveChipmunk-iPhone";
27392789
targetProxy = D2FEB60F194F6C9E00FC0574 /* PBXContainerItemProxy */;
27402790
};
2791+
FC55599D1991A25A00E29CCE /* PBXTargetDependency */ = {
2792+
isa = PBXTargetDependency;
2793+
name = tremor;
2794+
targetProxy = FC55599C1991A25A00E29CCE /* PBXContainerItemProxy */;
2795+
};
27412796
/* End PBXTargetDependency section */
27422797

27432798
/* Begin XCBuildConfiguration section */
@@ -3018,13 +3073,16 @@
30183073
"$(SRCROOT)/external/Chipmunk/include",
30193074
"$(SRCROOT)/external/Chipmunk/objectivec/include",
30203075
"$(SRCROOT)/external/ObjectAL/**",
3076+
"$(SRCROOT)/external/tremor/include",
3077+
"$(SRCROOT)/external/ogg/include",
30213078
);
30223079
LIBRARY_SEARCH_PATHS = (
30233080
"$(inherited)",
30243081
"\\\\\\\"$(SRCROOT)/build/Debug-iphonesimulator\\\\\\\"",
30253082
"$(SDKROOT)/usr/lib/armeabi",
30263083
"$(SDKROOT)/usr/lib/armv7a",
30273084
"$(SDKROOT)/usr/lib/x86",
3085+
"$(PROJECT_DIR)/external/ogg/android/ogg/build/Debug-android",
30283086
);
30293087
ONLY_ACTIVE_ARCH = YES;
30303088
OTHER_LDFLAGS = "";
@@ -3062,13 +3120,16 @@
30623120
"$(SRCROOT)/external/Chipmunk/include",
30633121
"$(SRCROOT)/external/Chipmunk/objectivec/include",
30643122
"$(SRCROOT)/external/ObjectAL/**",
3123+
"$(SRCROOT)/external/tremor/include",
3124+
"$(SRCROOT)/external/ogg/include",
30653125
);
30663126
LIBRARY_SEARCH_PATHS = (
30673127
"$(inherited)",
30683128
"\\\\\\\"$(SRCROOT)/build/Debug-iphonesimulator\\\\\\\"",
30693129
"$(SDKROOT)/usr/lib/armeabi",
30703130
"$(SDKROOT)/usr/lib/armv7a",
30713131
"$(SDKROOT)/usr/lib/x86",
3132+
"$(PROJECT_DIR)/external/ogg/android/ogg/build/Debug-android",
30723133
);
30733134
OTHER_LDFLAGS = "";
30743135
PRODUCT_NAME = cocos2dAndroid;

cocos2d-osx.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@
169169
D216F92D1970A35A000DEF7C /* ALWeakDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = D216F9271970A35A000DEF7C /* ALWeakDictionary.m */; };
170170
D216F92E1970A35A000DEF7C /* ALWeakElement.h in Headers */ = {isa = PBXBuildFile; fileRef = D216F9281970A35A000DEF7C /* ALWeakElement.h */; };
171171
D216F92F1970A35A000DEF7C /* ALWeakElement.m in Sources */ = {isa = PBXBuildFile; fileRef = D216F9291970A35A000DEF7C /* ALWeakElement.m */; };
172+
D2342007199AD36D00DF8FCD /* CCNoARC.m in Sources */ = {isa = PBXBuildFile; fileRef = D2342004199AD36D00DF8FCD /* CCNoARC.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
173+
D2342008199AD36D00DF8FCD /* CCRenderDispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = D2342005199AD36D00DF8FCD /* CCRenderDispatch.h */; };
174+
D2342009199AD36D00DF8FCD /* CCRenderDispatch.m in Sources */ = {isa = PBXBuildFile; fileRef = D2342006199AD36D00DF8FCD /* CCRenderDispatch.m */; };
172175
D2D598641987132700BDAF25 /* CCEffect_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = D2D598421987132700BDAF25 /* CCEffect_Private.h */; };
173176
D2D598651987132700BDAF25 /* CCEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = D2D598431987132700BDAF25 /* CCEffect.h */; };
174177
D2D598661987132700BDAF25 /* CCEffect.m in Sources */ = {isa = PBXBuildFile; fileRef = D2D598441987132700BDAF25 /* CCEffect.m */; };
@@ -540,6 +543,9 @@
540543
D216F9271970A35A000DEF7C /* ALWeakDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ALWeakDictionary.m; sourceTree = "<group>"; };
541544
D216F9281970A35A000DEF7C /* ALWeakElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALWeakElement.h; sourceTree = "<group>"; };
542545
D216F9291970A35A000DEF7C /* ALWeakElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ALWeakElement.m; sourceTree = "<group>"; };
546+
D2342004199AD36D00DF8FCD /* CCNoARC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCNoARC.m; sourceTree = "<group>"; };
547+
D2342005199AD36D00DF8FCD /* CCRenderDispatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderDispatch.h; sourceTree = "<group>"; };
548+
D2342006199AD36D00DF8FCD /* CCRenderDispatch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCRenderDispatch.m; sourceTree = "<group>"; };
543549
D2D598421987132700BDAF25 /* CCEffect_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEffect_Private.h; sourceTree = "<group>"; };
544550
D2D598431987132700BDAF25 /* CCEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEffect.h; sourceTree = "<group>"; };
545551
D2D598441987132700BDAF25 /* CCEffect.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffect.m; sourceTree = "<group>"; };
@@ -1342,6 +1348,9 @@
13421348
D3AD531F18C84FC9005B6CF3 /* CCRenderer_private.h */,
13431349
D3AD532018C84FC9005B6CF3 /* CCRenderer.h */,
13441350
D3AD532118C84FC9005B6CF3 /* CCRenderer.m */,
1351+
D2342004199AD36D00DF8FCD /* CCNoARC.m */,
1352+
D2342005199AD36D00DF8FCD /* CCRenderDispatch.h */,
1353+
D2342006199AD36D00DF8FCD /* CCRenderDispatch.m */,
13451354
);
13461355
path = cocos2d;
13471356
sourceTree = "<group>";
@@ -1748,6 +1757,7 @@
17481757
B7E2603517E7C774007067F0 /* NSEvent+CC.h in Headers */,
17491758
B77060961831B0C40043CC67 /* OALAudioFile.h in Headers */,
17501759
B7E2603917E7C786007067F0 /* UITouch+CC.h in Headers */,
1760+
D2342008199AD36D00DF8FCD /* CCRenderDispatch.h in Headers */,
17511761
D2D5987E1987132700BDAF25 /* CCEffectSaturation.h in Headers */,
17521762
);
17531763
runOnlyForDeploymentPostprocessing = 0;
@@ -1870,6 +1880,7 @@
18701880
E076E6DA1225EC7400DE0DA2 /* CCActionInstant.m in Sources */,
18711881
E076E6DC1225EC7400DE0DA2 /* CCActionInterval.m in Sources */,
18721882
B77060901831B0C40043CC67 /* mach_timing.c in Sources */,
1883+
D2342009199AD36D00DF8FCD /* CCRenderDispatch.m in Sources */,
18731884
E076E6DE1225EC7400DE0DA2 /* CCActionManager.m in Sources */,
18741885
B791E851182065BD00DAE1D7 /* CCTiledMapLayer.m in Sources */,
18751886
E076E6E21225EC7400DE0DA2 /* CCActionProgressTimer.m in Sources */,
@@ -1897,6 +1908,7 @@
18971908
B770606C1831B0C40043CC67 /* OALAudioTrackNotifications.m in Sources */,
18981909
E076E7161225EC7400DE0DA2 /* CCProgressNode.m in Sources */,
18991910
D2D598851987132700BDAF25 /* CCEffectUtils.m in Sources */,
1911+
D2342007199AD36D00DF8FCD /* CCNoARC.m in Sources */,
19001912
B77060831831B0C40043CC67 /* ALSource.m in Sources */,
19011913
E076E7191225EC7400DE0DA2 /* CCRenderTexture.m in Sources */,
19021914
E076E71D1225EC7400DE0DA2 /* CCScene.m in Sources */,

cocos2d-tests-android/Headless.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,8 +1011,8 @@
10111011
OTHER_LDFLAGS = (
10121012
"-landroid",
10131013
"-lgles_apportable",
1014-
"-all_load",
10151014
"-ObjC",
1015+
"-all_load",
10161016
);
10171017
PRODUCT_NAME = "$(TARGET_NAME)";
10181018
WRAPPER_EXTENSION = app;

cocos2d-tests-android/Headless/tests/CCTextFieldTest.m

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
//
2+
// CCTextFieldTest.m
3+
// cocos2d-ui-tests-osx
4+
//
5+
// Created by Viktor on 10/23/13.
6+
// Copyright (c) 2013 Cocos2d. All rights reserved.
7+
//
8+
9+
#import "TestBase.h"
10+
#if !__CC_PLATFORM_ANDROID_COMPILE_ON_IOS_LAWLZ
11+
#import "CCTextField.h"
12+
#endif
13+
14+
@interface CCTextFieldTest : TestBase @end
15+
16+
@implementation CCTextFieldTest
17+
18+
- (NSArray*) testConstructors
19+
{
20+
return [NSArray arrayWithObjects:
21+
@"setupTextFieldBasicTest",
22+
nil];
23+
}
24+
25+
- (void) setupTextFieldBasicTest
26+
{
27+
#if !__CC_PLATFORM_ANDROID_COMPILE_ON_IOS_LAWLZ
28+
self.subTitle = @"Tests text fields.";
29+
30+
CCSpriteFrame* bg = [CCSpriteFrame frameWithImageNamed:@"Tests/textfield-bg.png"];
31+
CCTextField* textField = [[CCTextField alloc] initWithSpriteFrame:bg];
32+
33+
textField.preferredSizeType = CCSizeTypeMake(CCSizeUnitNormalized, CCSizeUnitPoints);
34+
textField.preferredSize = CGSizeMake(0.5, 50);
35+
textField.positionType = CCPositionTypeNormalized;
36+
textField.position = ccp(0.5f, 0.8f);
37+
textField.padding = 6;
38+
textField.anchorPoint = ccp(0.5f, 0.5f);
39+
textField.string = @"Hello!";
40+
41+
[textField setTarget:self selector:@selector(pressedEnter:)];
42+
43+
[self.contentNode addChild:textField];
44+
#endif
45+
}
46+
47+
- (void) pressedEnter:(id)sender
48+
{
49+
CCTextField* textField = sender;
50+
51+
NSLog(@"Finished editing: %@", textField.string);
52+
53+
self.subTitle = [NSString stringWithFormat:@"Editing: '%@'", textField.string];
54+
55+
}
56+
57+
@end

cocos2d-ui-tests/tests/CCTextFieldTest.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ - (void) setupTextFieldBasicTest
2828
CCTextField* textField = [[CCTextField alloc] initWithSpriteFrame:bg];
2929

3030
textField.preferredSizeType = CCSizeTypeMake(CCSizeUnitNormalized, CCSizeUnitPoints);
31-
textField.preferredSize = CGSizeMake(0.5, 36);
31+
textField.preferredSize = CGSizeMake(0.5, 50);
3232
textField.positionType = CCPositionTypeNormalized;
33-
textField.position = ccp(0.5f, 0.5f);
33+
textField.position = ccp(0.5f, 0.8f);
3434
textField.padding = 6;
3535
textField.anchorPoint = ccp(0.5f, 0.5f);
3636
textField.string = @"Hello!";
@@ -45,6 +45,8 @@ - (void) pressedEnter:(id)sender
4545
CCTextField* textField = sender;
4646

4747
NSLog(@"Finished editing: %@", textField.string);
48+
49+
self.subTitle = [NSString stringWithFormat:@"Editing: '%@'", textField.string];
4850
}
4951

5052
@end

cocos2d-ui-tests/tests/ObjectALTest.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ - (void) setupSimpleAudioTest
4949

5050
- (void) playSimpleSound:(id)sender
5151
{
52+
#if ANDROID
53+
[[OALSimpleAudio sharedInstance] playEffect:@"Sounds/sound.ogg"];
54+
#else
5255
[[OALSimpleAudio sharedInstance] playEffect:@"Sounds/sound.wav"];
56+
#endif
5357
}
5458

5559

0 commit comments

Comments
 (0)