Skip to content

Commit

Permalink
update sample touchsprite
Browse files Browse the repository at this point in the history
  • Loading branch information
yuleiliao committed May 14, 2014
1 parent 38c3ad2 commit c256821
Show file tree
Hide file tree
Showing 47 changed files with 2,080 additions and 950 deletions.
2 changes: 1 addition & 1 deletion samples/touchsprite/proj.android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="quick.cocoachina.com.samples.touchsprite"
package="com.cocoachina.quick.samples.touchsprite"
android:versionCode="1"
android:versionName="1.0">

Expand Down
3 changes: 1 addition & 2 deletions samples/touchsprite/proj.android/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ LOCAL_MODULE := game_shared
LOCAL_MODULE_FILENAME := libgame

LOCAL_SRC_FILES := hellocpp/main.cpp \
../../sources/AppDelegate.cpp \
../../sources/SimulatorConfig.cpp
../../sources/AppDelegate.cpp

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

Expand Down
Binary file modified samples/touchsprite/proj.android/res/drawable-hdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/touchsprite/proj.android/res/drawable-ldpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/touchsprite/proj.android/res/drawable-mdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ of this software and associated documentation files (the "Software"), to deal
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
package quick.cocoachina.com.samples.touchsprite;
package com.cocoachina.quick.samples.touchsprite;

import org.cocos2dx.lib.Cocos2dxActivity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ of this software and associated documentation files (the "Software"), to deal
THE SOFTWARE.
****************************************************************************/
#import <UIKit/UIKit.h>
#import <AVFoundation/AVAudioSession.h>
#import "AppController.h"
#import "cocos2d.h"
#import "EAGLView.h"
Expand Down Expand Up @@ -49,7 +50,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
multiSampling: NO
numberOfSamples: 0];
// Enable multi-touches
[__glView setMultipleTouchEnabled:YES];
// [__glView setMultipleTouchEnabled:YES];

// Use RootViewController manage EAGLView
viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];
Expand Down Expand Up @@ -96,6 +97,8 @@ - (void)applicationWillEnterForeground:(UIApplication *)application {
/*
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.
*/
NSError *err;
[[AVAudioSession sharedInstance] setActive:true error:&err];
cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground();
}

Expand Down
File renamed without changes.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/touchsprite/proj.ios/Resources/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<string>Icon-72.png</string>
</array>
<key>CFBundleIdentifier</key>
<string>quick.cocoachina.com.samples.${PRODUCT_NAME:rfc1034identifier}</string>
<string>com.cocoachina.quick.samples.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
File renamed without changes.
222 changes: 96 additions & 126 deletions samples/touchsprite/proj.ios/touchsprite.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
53 changes: 53 additions & 0 deletions samples/touchsprite/proj.mac/AppController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/****************************************************************************
Copyright (c) 2010 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/

#import "EAGLView.h"

#include <string>
#include "ProjectConfig/SimulatorConfig.h"
#include "AppDelegate.h"

@interface AppController : NSObject <NSApplicationDelegate, NSWindowDelegate>
{
NSWindow *window;
EAGLView *glView;
NSMenu *menu;

BOOL isAlwaysOnTop;

AppDelegate *app;
ProjectConfig projectConfig;
}

@property (nonatomic, assign) IBOutlet NSMenu* menu;

- (IBAction) onFileRelaunch:(id)sender;

- (IBAction) onScreenPortait:(id)sender;
- (IBAction) onScreenLandscape:(id)sender;
- (IBAction) onScreenZoomOut:(id)sender;

- (IBAction) onWindowAlwaysOnTop:(id)sender;

@end
Loading

0 comments on commit c256821

Please sign in to comment.