1 #include "ConstantsAndMacros.h"
3 #import "SettingsMenu.h"
5 typedef void (*control_callback)(float percent);
7 typedef struct Joystick
9 // Value between -1.0 and 1.0
10 bool_t can_use_accelero;
11 control_callback up_down;
12 control_callback left_right;
15 typedef struct Controls
21 @interface HUD : UIViewController <UIAccelerometerDelegate, SettingsMenuDelegate> {
22 IBOutlet UILabel *messageBoxLabel;
23 IBOutlet UILabel *batteryLevelLabel;
25 IBOutlet UIImageView *batteryImageView;
26 IBOutlet UIImageView *joystickRightThumbImageView;
27 IBOutlet UIImageView *joystickRightBackgroundImageView;
28 IBOutlet UIImageView *joystickLeftThumbImageView;
29 IBOutlet UIImageView *joystickLeftBackgroundImageView;
31 IBOutlet UIButton *backToMainMenuButton;
32 IBOutlet UIButton *settingsButton;
33 IBOutlet UIButton *switchScreenButton;
34 IBOutlet UIButton *takeOffButton;
35 IBOutlet UIButton *emergencyButton;
37 IBOutlet UIButton *joystickRightButton;
38 IBOutlet UIButton *joystickLeftButton;
47 @property (nonatomic, assign) BOOL firePressed;
48 @property (nonatomic, assign) BOOL settingsPressed;
49 @property (nonatomic, assign) BOOL mainMenuPressed;
51 - (id)initWithFrame:(CGRect)frame withState:(BOOL)inGame withHUDConfiguration:(ARDroneHUDConfiguration)hudconfiguration withControlData:(ControlData*)data;
52 - (void)setMessageBox:(NSString*)str;
53 - (void)setTakeOff:(NSString*)str;
54 - (void)setEmergency:(NSString*)str;
55 - (void)setBattery:(int)percent;
56 - (void)changeState:(BOOL)inGame;
57 - (void)showBackToMainMenu:(BOOL)show;
59 - (IBAction)buttonPress:(id)sender forEvent:(UIEvent *)event;
60 - (IBAction)buttonRelease:(id)sender forEvent:(UIEvent *)event;
61 - (IBAction)buttonClick:(id)sender forEvent:(UIEvent *)event;
62 - (IBAction)buttonDrag:(id)sender forEvent:(UIEvent *)event;