forked from alinebee/Boxer
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated the Joypad SDK to the latest post-0.1.5.1 version.
- Loading branch information
Showing
10 changed files
with
150 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// | ||
// JoypadConstants.h | ||
// Joypad SDK | ||
// | ||
// Created by Lou Zell on 6/1/11. | ||
// Copyright 2011 Hazelmade. All rights reserved. | ||
// Copyright 2011 Joypad Inc. All rights reserved. | ||
// | ||
// Please email questions to me, Lou, at [email protected] | ||
// Please email questions to [email protected] | ||
// __________________________________________________________________________ | ||
// | ||
|
||
typedef struct | ||
|
@@ -26,8 +26,7 @@ typedef enum | |
kJoyInputTypeDpad, | ||
kJoyInputTypeButton, | ||
kJoyInputTypeAnalogStick, | ||
kJoyInputTypeAccelerometer, | ||
kJoyInputTypeWheel | ||
kJoyInputTypeAccelerometer | ||
}JoyInputType; | ||
|
||
typedef enum | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
// | ||
// JoypadControllerLayout.h | ||
// Joypad SDK | ||
// | ||
// Created by Lou Zell on 3/14/11. | ||
// Copyright 2011 Hazelmade. All rights reserved. | ||
// Copyright 2011 Joypad Inc. All rights reserved. | ||
// | ||
// Please email questions to me, Lou, at [email protected] | ||
// ----------------------------------------------------------------- | ||
// Please email questions to [email protected] | ||
// __________________________________________________________________________ | ||
// | ||
// Examples of several custom controllers can be found in MyJoypadLayout.m in | ||
// the JoypadiOSSample project that comes with the SDK download. | ||
// | ||
// This is the class that you will use to create a custom layout for your | ||
// application. Each method listed in the Public API section below adds | ||
// one component to your controller. Currently, you can add: | ||
// | ||
// * Analog sticks | ||
// * Re-centering analog sticks | ||
// * Dpads | ||
// * Buttons | ||
// * Accelerometer Data (this components doesn't add a view) | ||
// | ||
// See the comments at the top of each method for instructions on using it. | ||
// | ||
// An example of building a custom controller from start to finish is in | ||
// the README that comes with the SDK download, which is also at: | ||
// http://getjoypad.com/sdk_doc.html | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#if TARGET_OS_IPHONE | ||
|
@@ -39,6 +37,12 @@ | |
|
||
#pragma mark Public API | ||
|
||
/** | ||
* Returns a new autoreleased layout: | ||
* JoypadControllerLayout *myLayout = [JoypadControllerLayout layout]; | ||
*/ | ||
+(JoypadControllerLayout *)layout; | ||
|
||
/** | ||
* Set the name of this layout. This name will be displayed in the Connection Modal on Joypad | ||
* when a connection occurs. | ||
|
@@ -102,10 +106,19 @@ | |
-(void)addAccelerometer; | ||
|
||
/** | ||
* Adds an analog stick with origin at the center of the frame. | ||
* Adds an analog stick with origin at the center of the frame. This stick does not | ||
* recenter around the initial touch point. See the next method for more flexibility. | ||
*/ | ||
-(void)addAnalogStickWithFrame:(CGRect)rect identifier:(JoyInputIdentifier)inputId; | ||
|
||
/** | ||
* Same as above with an extra parameter to specify if the analog stick should recenter at the | ||
* initial touch down point. This gives it a hybrid feel between an analog stick and trackpad. | ||
* Recentering analog sticks are ideal for camera movement in a FPS. For player movement, | ||
* it is best to stick with a stationary analog stick (i.e. pass NO as the last argument). | ||
*/ | ||
-(void)addAnalogStickWithFrame:(CGRect)rect identifier:(JoyInputIdentifier)inputId recentering:(BOOL)recentering; | ||
|
||
/** | ||
* Equal if controller layouts have the same input components (buttons, labels, dpads, name, etc.) | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,32 @@ | ||
// | ||
// JoypadDevice.h | ||
// Joypad SDK | ||
// | ||
// Created by Lou Zell on 2/25/11. | ||
// Copyright 2011 Hazelmade. All rights reserved. | ||
// Copyright 2011 Joypad Inc. All rights reserved. | ||
// | ||
// Please email questions to me, Lou, at [email protected] | ||
// Please email questions to [email protected] | ||
// __________________________________________________________________________ | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "JoypadConstants.h" | ||
|
||
// Forward declarations. | ||
@protocol JoypadDeviceDelegate; | ||
|
||
@interface JoypadDevice : NSObject | ||
|
||
/** | ||
* Sets the object that will receive input from a JoypadDevice. | ||
* See the JoypadDeviceDelegate Category at the bottom of this header. | ||
*/ | ||
-(void)setDelegate:(id)aDelegate; | ||
-(void)setDelegate:(id<JoypadDeviceDelegate>)aDelegate; | ||
|
||
/** | ||
* Gets the object that will receive input from a JoypadDevice. | ||
* See the JoypadDeviceDelegate Category at the bottom of this header. | ||
*/ | ||
-(id)delegate; | ||
-(id<JoypadDeviceDelegate>)delegate; | ||
|
||
/** | ||
* The name of this device. This is the name that is displayed | ||
|
@@ -32,11 +35,10 @@ | |
-(NSString *)name; | ||
|
||
/** | ||
* The player number of this device. You set the player number when | ||
* you initiate a connection. For example: | ||
* | ||
* -[JoypadManager connectToDevice:aDevice asPlayer:2]; | ||
* | ||
* The player number of this device. This will be set automatically | ||
* by the sdk based on the order of connections. As players drop out | ||
* in a multiplayer game, new players will fill their old spots in | ||
* ascending order. | ||
*/ | ||
-(unsigned int)playerNumber; | ||
|
||
|
@@ -54,8 +56,8 @@ | |
|
||
|
||
|
||
@interface NSObject (JoypadDeviceDelegate) | ||
|
||
@protocol JoypadDeviceDelegate <NSObject> | ||
@optional | ||
/** | ||
Implement the following methods in the class that will receive input from Joypad. | ||
|
Oops, something went wrong.