Gorilla.UI.VirtualGamepad
Unit Gorilla.UI.VirtualGamepad.pasClasses
- TImageRectangle = class ( TRectangle )
- TImageRoundRect = class ( TRoundRect )
- TImageCircle = class ( TCircle )
- TGorillaVirtualGamepad = class ( TImageRectangle )
Constants
- const GORILLA_VIRTUALGAMEPAD_ID_MOVEMENTAREA_LEFT : string = "LeftMovementArea";
- const GORILLA_VIRTUALGAMEPAD_ID_MOVEMENTCIRCLEAREA_LEFT : string = "LeftMovementCircleArea";
- const GORILLA_VIRTUALGAMEPAD_ID_STICK_LEFT : string = "LeftStick";
- const GORILLA_VIRTUALGAMEPAD_ID_MOVEMENTAREA_RIGHT : string = "RightMovementArea";
- const GORILLA_VIRTUALGAMEPAD_ID_MOVEMENTCIRCLEAREA_RIGHT : string = "RightMovementCircleArea";
- const GORILLA_VIRTUALGAMEPAD_ID_STICK_RIGHT : string = "RightStick";
- const GORILLA_VIRTUALGAMEPAD_ID_CURSORAREA : string = "CursorArea";
- const GORILLA_VIRTUALGAMEPAD_ID_SHOULDERAREA : string = "ShoulderArea";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTONAREA : string = "ButtonArea";
- const GORILLA_VIRTUALGAMEPAD_ID_SYSTEMBUTTONAREA : string = "SystemButtonArea";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTONA : string = "ButtonA";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTONB : string = "ButtonB";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTONX : string = "ButtonX";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTONY : string = "ButtonY";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTONSTART : string = "ButtonStart";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTONMODE : string = "ButtonMode";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTONBACK : string = "ButtonBack";
- const GORILLA_VIRTUALGAMEPAD_ID_INFOLABEL : string = "InfoLabel";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTON_CURSOR_UP : string = "ButtonCursorUp";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTON_CURSOR_DOWN : string = "ButtonCursorDown";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTON_CURSOR_LEFT : string = "ButtonCursorLeft";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTON_CURSOR_RIGHT : string = "ButtonCursorRight";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTON_SHOULDER_LEFT : string = "ButtonShoulderLeft";
- const GORILLA_VIRTUALGAMEPAD_ID_BUTTON_SHOULDER_RIGHT : string = "ButtonShoulderRight";
TImageRectangle
TImageRoundRect
Ancestors
Members
Fields
- protected FImage :
TImage
- protected FStoredColor :
TAlphaColor
- protected FHover :
TAlphaColor
- protected FPressed :
TAlphaColor
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetImage ( ) : TBitmap ;
- protected procedure SetImage ( const AValue : TBitmap ) ;
- protected procedure DoOnMouseEnter ( ASender : TObject ) ; virtual;
- protected procedure DoOnMouseLeave ( ASender : TObject ) ; virtual;
- protected procedure DoOnMouseMove ( Sender : TObject; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
Properties
TImageCircle
TGorillaVirtualGamepad
Ancestors
Members
Fields
- protected FEditMode :
Boolean
- protected FDispatchLeftStickTimer :
TTimer
- protected FDispatchRightStickTimer :
TTimer
- protected FLeftStickOutOfFocusTimer :
TTimer
- protected FRightStickOutOfFocusTimer :
TTimer
- protected FLeftMovementArea :
TImageRectangle
- protected FRightMovementArea :
TImageRectangle
- protected FCursorArea :
TImageRectangle
- protected FShoulderArea :
TImageRectangle
- protected FButtonArea :
TImageRectangle
- protected FSystemButtonArea :
TImageRectangle
- protected FLeftMovementCircleArea :
TImageCircle
- protected FRightMovementCircleArea :
TImageCircle
- protected FButtonA :
TImageRoundRect
- protected FButtonB :
TImageRoundRect
- protected FButtonX :
TImageRoundRect
- protected FButtonY :
TImageRoundRect
- protected FButtonStart :
TImageRoundRect
- protected FButtonMode :
TImageRoundRect
- protected FButtonBack :
TImageRoundRect
- protected FButtonCursorUp :
TImageRoundRect
- protected FButtonCursorDown :
TImageRoundRect
- protected FButtonCursorLeft :
TImageRoundRect
- protected FButtonCursorRight :
TImageRoundRect
- protected FButtonShoulderLeft :
TImageRoundRect
- protected FButtonShoulderRight :
TImageRoundRect
- protected FLeftStick :
TImageCircle
- protected FRightStick :
TImageCircle
- protected FInfoLabel :
TLabel
- protected FLastLeftStickPos :
TPointF
- protected FLeftStickMove :
Boolean
- protected FLeftStickPosMsg :
TGorillaInputMessage
- protected FRightStickPosMsg :
TGorillaInputMessage
- protected FLastRightStickPos :
TPointF
- protected FRightStickMove :
Boolean
- protected FRightStickPos :
TGorillaInputMessage
- protected FInputController :
TGorillaInputController
- protected FHandler :
TGorillaInputHandler
- protected FOnMessage :
TOnVirtualGamepadMessage
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetLeftStickNormal ( ) : TPointF ;
- protected function GetRightStickNormal ( ) : TPointF ;
- protected function GetComponentId ( AId : string ) : string ;
- protected procedure SetEditMode ( const AValue : Boolean ) ;
- protected procedure DoOnLoadImageInEditMode ( ASender : TObject ) ;
- protected procedure SetLeftMovementArea ( const AValue : TImageRectangle ) ;
- protected procedure SetRightMovementArea ( const AValue : TImageRectangle ) ;
- protected procedure SetLeftMovementCircleArea ( const AValue : TImageCircle ) ;
- protected procedure SetRightMovementCircleArea ( const AValue : TImageCircle ) ;
- protected procedure SetLeftStick ( const AValue : TImageCircle ) ;
- protected procedure SetRightStick ( const AValue : TImageCircle ) ;
- protected procedure SetCursorArea ( const AValue : TImageRectangle ) ;
- protected procedure SetShoulderArea ( const AValue : TImageRectangle ) ;
- protected procedure SetButtonArea ( const AValue : TImageRectangle ) ;
- protected procedure SetSystemButtonArea ( const AValue : TImageRectangle ) ;
- protected procedure SetInfoLabel ( const AValue : TLabel ) ;
- protected procedure SetButtonA ( const AValue : TImageRoundRect ) ;
- protected procedure SetButtonB ( const AValue : TImageRoundRect ) ;
- protected procedure SetButtonX ( const AValue : TImageRoundRect ) ;
- protected procedure SetButtonY ( const AValue : TImageRoundRect ) ;
- protected procedure SetButtonStart ( const AValue : TImageRoundRect ) ;
- protected procedure SetButtonMode ( const AValue : TImageRoundRect ) ;
- protected procedure SetButtonBack ( const AValue : TImageRoundRect ) ;
- protected procedure SetButtonCursorUp ( const AValue : TImageRoundRect ) ;
- protected procedure SetButtonCursorDown ( const AValue : TImageRoundRect ) ;
- protected procedure SetButtonCursorLeft ( const AValue : TImageRoundRect ) ;
- protected procedure SetButtonCursorRight ( const AValue : TImageRoundRect ) ;
- protected procedure SetButtonShoulderLeft ( const AValue : TImageRoundRect ) ;
- protected procedure SetButtonShoulderRight ( const AValue : TImageRoundRect ) ;
- protected procedure Loaded ( ) ; override;
- protected procedure DoClear ( ) ; virtual;
- protected procedure DoUnlink ( ) ; virtual;
- protected procedure DoRelink ( ) ; virtual;
- protected procedure DoSetup ( ) ; virtual;
- protected procedure DoSetupVirtualGamepad ( ) ; virtual;
- protected procedure DoSetupMovementArea ( ) ; virtual;
- protected procedure DoSetupMovementCircleArea ( ) ; virtual;
- protected procedure DoSetupStick ( ) ; virtual;
- protected procedure DoSetupButtonA ( ) ; virtual;
- protected procedure DoSetupButtonB ( ) ; virtual;
- protected procedure DoSetupButtonX ( ) ; virtual;
- protected procedure DoSetupButtonY ( ) ; virtual;
- protected procedure DoSetupButtonArea ( ) ; virtual;
- protected procedure DoSetupButtonStart ( ) ; virtual;
- protected procedure DoSetupButtonMode ( ) ; virtual;
- protected procedure DoSetupButtonBack ( ) ; virtual;
- protected procedure DoSetupInfoLabel ( ) ; virtual;
- protected procedure DoSetupSystemButtonArea ( ) ; virtual;
- protected procedure DoSetupCursorButtonUp ( ) ; virtual;
- protected procedure DoSetupCursorButtonDown ( ) ; virtual;
- protected procedure DoSetupCursorButtonLeft ( ) ; virtual;
- protected procedure DoSetupCursorButtonRight ( ) ; virtual;
- protected procedure DoSetupCursorArea ( ) ; virtual;
- protected procedure DoSetupShoulderButtonLeft ( ) ; virtual;
- protected procedure DoSetupShoulderButtonRight ( ) ; virtual;
- protected procedure DoSetupShoulderArea ( ) ; virtual;
- protected function RequestCurrentLeftStickPosition ( ) : TPointF ;
- protected function RequestCurrentLeftStickOffset ( ) : TPointF ;
- protected procedure DoOnLeftStickMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnLeftStickMouseMove ( Sender : TObject; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnLeftStickMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnLeftStickMouseEnter ( ASender : TObject ) ; virtual;
- protected procedure DoOnLeftStickMouseLeave ( ASender : TObject ) ; virtual;
- protected function RequestCurrentRightStickPosition ( ) : TPointF ;
- protected function RequestCurrentRightStickOffset ( ) : TPointF ;
- protected procedure DoOnRightStickMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnRightStickMouseMove ( Sender : TObject; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnRightStickMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnRightStickMouseEnter ( ASender : TObject ) ; virtual;
- protected procedure DoOnRightStickMouseLeave ( ASender : TObject ) ; virtual;
- protected procedure DoCreateMouseDownMessage ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single; ACode : NativeInt ) ; virtual;
- protected procedure DoCreateMouseUpMessage ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single; ACode : NativeInt ) ; virtual;
- protected procedure DoOnButtonStartMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonStartMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonModeMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonModeMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonBackMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonBackMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonAMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonAMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonBMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonBMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonXMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonXMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonYMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonYMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonCursorUpMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonCursorUpMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonCursorDownMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonCursorDownMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonCursorLeftMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonCursorLeftMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonCursorRightMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonCursorRightMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonShoulderLeftMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonShoulderLeftMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonShoulderRightMouseDown ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DoOnButtonShoulderRightMouseUp ( Sender : TObject; Button : TMouseButton; Shift : TShiftState; X : Single; Y : Single ) ; virtual;
- protected procedure DispatchInputMessage ( AMessage : TGorillaInputMessage ) ; virtual;
- protected function DeepComponentSearch ( AParent : TFmxObject; AName : string ) : TFmxObject ;
- protected procedure DoOnDispatchLeftStickTimer ( ASender : TObject ) ;
- protected procedure DoOnDispatchRightStickTimer ( ASender : TObject ) ;
- protected procedure DoOnLeftStickOutOfFocusTimer ( ASender : TObject ) ;
- protected procedure DoOnRightStickOutOfFocusTimer ( ASender : TObject ) ;
- public procedure LoadLayoutFromStream
(
AStream :
TStream
)
;
The virtual gamepad supports different layouts and designs to be loaded.
- public procedure LoadLayoutFromFile
(
AFilename :
string
)
;
The virtual gamepad supports different layouts and designs to be loaded.
- public procedure SaveLayoutToStream
(
AStream :
TStream
)
;
Save the current gamepad design and layout to stream.
- public procedure SaveLayoutToFile
(
AFilename :
string
)
;
Save the current gamepad design and layout to a file.
Properties
- public LeftMovementArea : TImageRectangle
Get or set the visual representation of the button area at the left side of the virtual gamepad.
read FLeftMovementArea
write SetLeftMovementArea - public LeftMovementCircleArea : TImageCircle
Get or set the visual representation of a left circle inside of the movement area.
read FLeftMovementCircleArea
write SetLeftMovementCircleArea - public LeftStick : TImageCircle
- public RightMovementArea : TImageRectangle
Get or set the visual representation of the button area at the right side of the virtual gamepad.
read FRightMovementArea
write SetRightMovementArea - public RightMovementCircleArea : TImageCircle
Get or set the visual representation of a right circle inside of the movement area.
read FRightMovementCircleArea
write SetRightMovementCircleArea - public RightStick : TImageCircle
- public CursorArea : TImageRectangle
Area where all cursor buttons belong to for up-down-left-right movement.
read FCursorArea
write SetCursorArea - public ShoulderArea : TImageRectangle
- public ButtonArea : TImageRectangle
Get or set the visual representation of the button area at the right side of the virtual gamepad.
read FButtonArea
write SetButtonArea - public SystemButtonArea : TImageRectangle
Get or set the visual representation of the system button area in the middle of the virtual gamepad.
read FSystemButtonArea
write SetSystemButtonArea - public InfoLabel : TLabel
Get or set the visual representation of the an info label at the bottom.
read FInfoLabel
write SetInfoLabel - public ButtonA : TImageRoundRect
- public ButtonB : TImageRoundRect
- public ButtonX : TImageRoundRect
- public ButtonY : TImageRoundRect
- public ButtonStart : TImageRoundRect
- public ButtonMode : TImageRoundRect
- public ButtonBack : TImageRoundRect
- public LeftStickNormal : TPointF
- public RightStickNormal : TPointF
- published EditMode : Boolean
To build a design / layout for the virtual gamepad we need to disable gamepad functions and enable editing functions.
read FEditMode
write SetEditMode - published InputController : TGorillaInputController
Link an input controller to send messages to. The virtual gamepad will produce input messages and dispatch those to a linked controller.
read FInputController
write FInputController