X-Git-Url: http://git.maemo.org/git/?p=mardrone;a=blobdiff_plain;f=mardrone%2FARDrone_SDK_Version_1_8_20110726%2FControlEngine%2FiPhone%2FClasses%2FMenus%2FHUD.h;fp=mardrone%2FARDrone_SDK_Version_1_8_20110726%2FControlEngine%2FiPhone%2FClasses%2FMenus%2FHUD.h;h=99bfe88aa54992045c40f01354836a9a2dbfe87a;hp=0000000000000000000000000000000000000000;hb=9ec9bc13b75d30bc45535c54a652934debfcea92;hpb=ae0a3c2dc0898400aca0dd6b439c5db8044db7b2 diff --git a/mardrone/ARDrone_SDK_Version_1_8_20110726/ControlEngine/iPhone/Classes/Menus/HUD.h b/mardrone/ARDrone_SDK_Version_1_8_20110726/ControlEngine/iPhone/Classes/Menus/HUD.h new file mode 100644 index 0000000..99bfe88 --- /dev/null +++ b/mardrone/ARDrone_SDK_Version_1_8_20110726/ControlEngine/iPhone/Classes/Menus/HUD.h @@ -0,0 +1,63 @@ +#include "ConstantsAndMacros.h" +#import "ARDrone.h" +#import "SettingsMenu.h" + +typedef void (*control_callback)(float percent); + +typedef struct Joystick +{ + // Value between -1.0 and 1.0 + bool_t can_use_accelero; + control_callback up_down; + control_callback left_right; +} JOYSTICK; + +typedef struct Controls +{ + JOYSTICK Left; + JOYSTICK Right; +} CONTROLS; + +@interface HUD : UIViewController { + IBOutlet UILabel *messageBoxLabel; + IBOutlet UILabel *batteryLevelLabel; + + IBOutlet UIImageView *batteryImageView; + IBOutlet UIImageView *joystickRightThumbImageView; + IBOutlet UIImageView *joystickRightBackgroundImageView; + IBOutlet UIImageView *joystickLeftThumbImageView; + IBOutlet UIImageView *joystickLeftBackgroundImageView; + + IBOutlet UIButton *backToMainMenuButton; + IBOutlet UIButton *settingsButton; + IBOutlet UIButton *switchScreenButton; + IBOutlet UIButton *takeOffButton; + IBOutlet UIButton *emergencyButton; + + IBOutlet UIButton *joystickRightButton; + IBOutlet UIButton *joystickLeftButton; + + BOOL firePressed; + BOOL settingsPressed; + BOOL mainMenuPressed; + + CONTROLS controls; +} + +@property (nonatomic, assign) BOOL firePressed; +@property (nonatomic, assign) BOOL settingsPressed; +@property (nonatomic, assign) BOOL mainMenuPressed; + +- (id)initWithFrame:(CGRect)frame withState:(BOOL)inGame withHUDConfiguration:(ARDroneHUDConfiguration)hudconfiguration withControlData:(ControlData*)data; +- (void)setMessageBox:(NSString*)str; +- (void)setTakeOff:(NSString*)str; +- (void)setEmergency:(NSString*)str; +- (void)setBattery:(int)percent; +- (void)changeState:(BOOL)inGame; +- (void)showBackToMainMenu:(BOOL)show; + +- (IBAction)buttonPress:(id)sender forEvent:(UIEvent *)event; +- (IBAction)buttonRelease:(id)sender forEvent:(UIEvent *)event; +- (IBAction)buttonClick:(id)sender forEvent:(UIEvent *)event; +- (IBAction)buttonDrag:(id)sender forEvent:(UIEvent *)event; +@end