Skip to content

Commit c256821

Browse files
author
yuleiliao
committed
update sample touchsprite
1 parent 38c3ad2 commit c256821

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2080
-950
lines changed

samples/touchsprite/proj.android/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="quick.cocoachina.com.samples.touchsprite"
3+
package="com.cocoachina.quick.samples.touchsprite"
44
android:versionCode="1"
55
android:versionName="1.0">
66

samples/touchsprite/proj.android/jni/Android.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ LOCAL_MODULE := game_shared
77
LOCAL_MODULE_FILENAME := libgame
88

99
LOCAL_SRC_FILES := hellocpp/main.cpp \
10-
../../sources/AppDelegate.cpp \
11-
../../sources/SimulatorConfig.cpp
10+
../../sources/AppDelegate.cpp
1211

1312
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../sources
1413

Loading
Loading
Loading

samples/touchsprite/proj.android/src/quick/cocoachina/com/samples/touchsprite/Touchsprite.java renamed to samples/touchsprite/proj.android/src/com/cocoachina/quick/samples/touchsprite/Touchsprite.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ of this software and associated documentation files (the "Software"), to deal
2121
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
THE SOFTWARE.
2323
****************************************************************************/
24-
package quick.cocoachina.com.samples.touchsprite;
24+
package com.cocoachina.quick.samples.touchsprite;
2525

2626
import org.cocos2dx.lib.Cocos2dxActivity;
2727

samples/touchsprite/proj.ios/touchsprite/ios/AppController.mm renamed to samples/touchsprite/proj.ios/AppController.mm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ of this software and associated documentation files (the "Software"), to deal
2222
THE SOFTWARE.
2323
****************************************************************************/
2424
#import <UIKit/UIKit.h>
25+
#import <AVFoundation/AVAudioSession.h>
2526
#import "AppController.h"
2627
#import "cocos2d.h"
2728
#import "EAGLView.h"
@@ -49,7 +50,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
4950
multiSampling: NO
5051
numberOfSamples: 0];
5152
// Enable multi-touches
52-
[__glView setMultipleTouchEnabled:YES];
53+
// [__glView setMultipleTouchEnabled:YES];
5354

5455
// Use RootViewController manage EAGLView
5556
viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];
@@ -96,6 +97,8 @@ - (void)applicationWillEnterForeground:(UIApplication *)application {
9697
/*
9798
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
9899
*/
100+
NSError *err;
101+
[[AVAudioSession sharedInstance] setActive:true error:&err];
99102
cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground();
100103
}
101104

Loading
5.24 KB
Loading
Loading

samples/touchsprite/proj.ios/touchsprite/Resources/Info.plist renamed to samples/touchsprite/proj.ios/Resources/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<string>Icon-72.png</string>
1616
</array>
1717
<key>CFBundleIdentifier</key>
18-
<string>quick.cocoachina.com.samples.${PRODUCT_NAME:rfc1034identifier}</string>
18+
<string>com.cocoachina.quick.samples.${PRODUCT_NAME:rfc1034identifier}</string>
1919
<key>CFBundleInfoDictionaryVersion</key>
2020
<string>6.0</string>
2121
<key>CFBundleName</key>

samples/touchsprite/proj.ios/touchsprite.xcodeproj/project.pbxproj

Lines changed: 96 additions & 126 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/****************************************************************************
2+
Copyright (c) 2010 cocos2d-x.org
3+
4+
http://www.cocos2d-x.org
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.
23+
****************************************************************************/
24+
25+
#import "EAGLView.h"
26+
27+
#include <string>
28+
#include "ProjectConfig/SimulatorConfig.h"
29+
#include "AppDelegate.h"
30+
31+
@interface AppController : NSObject <NSApplicationDelegate, NSWindowDelegate>
32+
{
33+
NSWindow *window;
34+
EAGLView *glView;
35+
NSMenu *menu;
36+
37+
BOOL isAlwaysOnTop;
38+
39+
AppDelegate *app;
40+
ProjectConfig projectConfig;
41+
}
42+
43+
@property (nonatomic, assign) IBOutlet NSMenu* menu;
44+
45+
- (IBAction) onFileRelaunch:(id)sender;
46+
47+
- (IBAction) onScreenPortait:(id)sender;
48+
- (IBAction) onScreenLandscape:(id)sender;
49+
- (IBAction) onScreenZoomOut:(id)sender;
50+
51+
- (IBAction) onWindowAlwaysOnTop:(id)sender;
52+
53+
@end

0 commit comments

Comments
 (0)