04 September 2013, 16:36 | #1 |
Registered User
Join Date: Jun 2013
Location: Australia
Posts: 685
|
iAmiga Joystick fix
Hi Guys,
If you can compile and run iAmiga, but didn't figure the joystick out, it's not that they're swapped. The joystick is the whole screen, and it's just the fire button that isn't on the side of the screen you want it to be. This is the simplest fix I could come up with to make the entire right hand side of the display the fire button. Code:
const int kButtonWidthPortrait = 110; const int kButtonWidthLandscape = 200; @synthesize delegate; - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { // Initialization code //button = [[FireButtonView alloc] initWithFrame:CGRectMake(0, 0, kButtonWidthPortrait, frame.size.height)]; button = [[FireButtonView alloc] initWithFrame:CGRectMake(frame.size.width/2, 0, frame.size.width/2, frame.size.height)]; [self addSubview:button]; _deadZone = 20.0f; // radius, in pixels of the dead zone. _trackingStick = NO; _stickVector = new CGVector2D(); sharedInstance = self; TheJoyStick = &g_touchStick; } return self; } - (void)setDelegate:(id<InputControllerChangedDelegate>)theDelegate { delegate = theDelegate; button->delegate = theDelegate; } - (void)layoutSubviews { //CGPoint origin = self.frame.origin; CGSize size = self.frame.size; UIInterfaceOrientation current = (UIInterfaceOrientation)[[UIDevice currentDevice] orientation]; if (UIInterfaceOrientationIsLandscape(current)) { //button.frame = CGRectMake(0, 0, kButtonWidthLandscape, size.height); button.frame = CGRectMake(size.width/2, 0, size.width/2, size.height); //button.showImage = YES; } else { //button.frame = CGRectMake(0, 0, kButtonWidthPortrait, size.height); button.frame = CGRectMake(size.width/2, 0, size.width/2, size.height); //button.showImage = NO; } } kButtonWidthPortrait & kButtonWidthLandscape usually set the maximum display coordinate from the left that the fire button will still work. |
05 September 2013, 21:40 | #2 |
PSPUAE DEV
|
Be good if the controls were permanently on the screen.
I cant compile it though, dont have a mac. |
06 September 2013, 01:14 | #3 |
Registered User
Join Date: Jun 2013
Location: Australia
Posts: 685
|
|
06 September 2013, 11:28 | #4 |
PSPUAE DEV
|
|
06 September 2013, 16:37 | #5 |
Registered User
Join Date: Jun 2013
Location: Australia
Posts: 685
|
I mean don't have my act together at all (to compile, distribute via Cydia, etc.).
Once I got the developer stuff sorted I never bothered with the jailbreak route. Otherwise I'd have a distro that just downloads Turrican from the Factor 5 site on it's first launch |
06 September 2013, 18:19 | #6 |
PSPUAE DEV
|
LOL< dont need to do cydia, .
|
07 September 2013, 02:32 | #7 |
Registered User
Join Date: Jun 2013
Location: Australia
Posts: 685
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Quickshot Python: crap joystick or crappest joystick ever? | T_hairy_bootson | Nostalgia & memories | 141 | 13 September 2016 15:36 |
Joystick incompatibility since WinUAE V2.4.0 - needs a fix | Amigo | support.WinUAE | 7 | 13 August 2013 08:09 |
I need a Fix! | kipper2k | support.Apps | 3 | 08 September 2009 17:54 |
What Why and How to fix? | DDNI | support.Hardware | 5 | 28 May 2007 22:47 |
|
|