includes on screen controls

This commit is contained in:
Long Le committed 2023-06-27 14:13:05 -07:00
1 parent 1c90ee607a
commit 6740a7130b
48 files changed
+2474 -176

No files matched your search

+42 -1
View File
@@ -7,10 +7,15 @@
//
#import <Foundation/Foundation.h>
#import "ControllerSupport.h"
#import "OSCProfile.h"
@class ControllerSupport;
@class StreamConfiguration;
static const float D_PAD_DIST = 10;
static const float BUTTON_DIST = 20;
@interface OnScreenControls : NSObject
typedef NS_ENUM(NSInteger, OnScreenControlsLevel) {
@@ -18,6 +23,7 @@ typedef NS_ENUM(NSInteger, OnScreenControlsLevel) {
OnScreenControlsLevelAuto,
OnScreenControlsLevelSimple,
OnScreenControlsLevelFull,
OnScreenControlsCustom,
// Internal levels selected by ControllerSupport
OnScreenControlsLevelAutoGCGamepad,
@@ -25,12 +31,47 @@ typedef NS_ENUM(NSInteger, OnScreenControlsLevel) {
OnScreenControlsLevelAutoGCExtendedGamepadWithStickButtons
};
@property CALayer* _aButton;
@property CALayer* _bButton;
@property CALayer* _xButton;
@property CALayer* _yButton;
@property CALayer* _startButton;
@property CALayer* _selectButton;
@property CALayer* _r1Button;
@property CALayer* _r2Button;
@property CALayer* _r3Button;
@property CALayer* _l1Button;
@property CALayer* _l2Button;
@property CALayer* _l3Button;
@property CALayer* _upButton;
@property CALayer* _downButton;
@property CALayer* _leftButton;
@property CALayer* _rightButton;
@property CALayer* _leftStickBackground;
@property CALayer* _leftStick;
@property CALayer* _rightStickBackground;
@property CALayer* _rightStick;
@property CALayer *_dPadBackground; // parent layer that contains each individual dPad button so user can drag them around the screen together
@property float D_PAD_CENTER_X;
@property float D_PAD_CENTER_Y;
@property OnScreenControlsLevel _level;
@property NSMutableArray *OSCButtonLayers;
- (id) initWithView:(UIView*)view controllerSup:(ControllerSupport*)controllerSupport streamConfig:(StreamConfiguration*)streamConfig;
- (BOOL) handleTouchDownEvent:(NSSet*)touches;
- (BOOL) handleTouchUpEvent:(NSSet*)touches;
- (BOOL) handleTouchMovedEvent:(NSSet*)touches;
- (void) setLevel:(OnScreenControlsLevel)level;
- (OnScreenControlsLevel) getLevel;
- (void) show;
- (void) setupComplexControls;
- (void) drawButtons;
- (void) updateControls;
- (OnScreenControlsLevel) getLevel;
- (void) setDPadCenter;
- (void) setAnalogStickPositions;
- (void) positionOSCButtons;
@end