Class TCastleControl
Unit
Declaration
type TCastleControl = class(TPresentedControl)
Description
Control rendering "Castle Game Engine" on FMX form.
Source: delphi/fmx.castlecontrol.pas (line 73).
Hierarchy
- TObject
- TPresentedControl
- TCastleControl
Overview
Methods
| Protected | procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override; |
| Protected | procedure MouseMove(Shift: TShiftState; NewX, NewY: Single); override; |
| Protected | procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override; |
| Protected | procedure MouseWheel(Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean); override; |
| Protected | procedure KeyDown(var Key: Word; var KeyChar: WideChar; Shift: TShiftState); override; |
| Protected | procedure KeyUp(var Key: Word; var KeyChar: WideChar; Shift: TShiftState); override; |
| Protected | function DefinePresentationName: String; override; |
| Protected | procedure Resize; override; |
| Protected | procedure DoRootChanging(const NewRoot: IRoot); override; |
| Protected | procedure SetVisible(const AValue: Boolean); override; |
| Public | constructor Create(AOwner: TComponent); override; |
| Public | destructor Destroy; override; |
| Public | procedure Paint; override; |
| Public | procedure MultiTouchOnForm(const Form: TForm); |
| Public | procedure MultiTouchDetachForm; |
| Public | class procedure ProcessTasks; |
| Public | class procedure ApplicationRun; |
Properties
| Public | property ControlType default DefaultControlType; |
| Published | property Container: TCastleControlContainer read GetContainer; |
| Published | property Align; |
| Published | property Anchors; |
| Published | property OnClick; |
| Published | property OnDblClick; |
| Published | property Height; |
| Published | property Width; |
| Published | property Size; |
| Published | property Position; |
| Published | property Margins; |
| Published | property TabStop default true; |
| Published | property TabOrder; |
| Published | property CanFocus default True; |
Description
Methods
| Protected | procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override; |
|
This item has no description. | |
| Protected | procedure MouseMove(Shift: TShiftState; NewX, NewY: Single); override; |
|
This item has no description. | |
| Protected | procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override; |
|
This item has no description. | |
| Protected | procedure MouseWheel(Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean); override; |
|
This item has no description. | |
| Protected | procedure KeyDown(var Key: Word; var KeyChar: WideChar; Shift: TShiftState); override; |
|
This item has no description. | |
| Protected | procedure KeyUp(var Key: Word; var KeyChar: WideChar; Shift: TShiftState); override; |
|
This item has no description. | |
| Protected | function DefinePresentationName: String; override; |
|
This item has no description. | |
| Protected | procedure Resize; override; |
|
This item has no description. | |
| Protected | procedure DoRootChanging(const NewRoot: IRoot); override; |
|
Not needed in the end // procedure DoRootChanged; override; | |
| Protected | procedure SetVisible(const AValue: Boolean); override; |
|
This item has no description. | |
| Public | constructor Create(AOwner: TComponent); override; |
|
This item has no description. | |
| Public | destructor Destroy; override; |
|
This item has no description. | |
| Public | procedure Paint; override; |
|
This item has no description. | |
| Public | procedure MultiTouchOnForm(const Form: TForm); |
|
Handle touches with multiple fingers (on platforms that support it, like Android and iOS). Without calling this, we only handle mouse events, and FMX reports only the first finger as a mouse. Pass the form on which this control is placed. We need to listen on the form OnTouch event, as this is the only way to get information about all the touches from FMX. So calling this method assigns Form.OnTouch, you should not assign it to anything else afterwards. This means you can call this method for only one TCastleControl on a form. After calling this, we ignore the mouse events that FMX generates for touches (as we get the same information through Form.OnTouch). We still handle the events from a real mouse. | |
| Public | procedure MultiTouchDetachForm; |
|
Stop listening to multi-touch events on the form. If you called MultiTouchOnForm earlier, then this clears form's OnTouch event. Usually you don't need to call this manually. We detach from form when the TCastleControl is destroyed, so everything works if form is freed after the TCastleControl. If you plan to free the form before freeing this TCastleControl, you should call this method first. | |
| Public | class procedure ProcessTasks; |
|
On some platforms (Linux now) if you call Application.ProcessMessages, make sure to also call this method. E.g. while SomeCondition do begin Application.ProcessMessages; TCastleControl.ProcessTasks; end;
This does nothing on some other platforms (Windows) when it is not necessary and Application.ProcessMessages does all CGE job. | |
| Public | class procedure ApplicationRun; |
|
On some platforms (Linux now) you cannot just call Application.Run, as we need to call CGE processing regularly. So instead call this method. This ensures that engine updates / renders regularly. On some other platforms (Windows) this just calls Application.Run, which already makes engine processing correct. | |
Properties
| Public | property ControlType default DefaultControlType; |
|
This item has no description. | |
| Published | property Container: TCastleControlContainer read GetContainer; |
|
Access Castle Game Engine container properties and events, not specific to FMX. | |
| Published | property Align; |
|
This item has no description. | |
| Published | property Anchors; |
|
This item has no description. | |
| Published | property OnClick; |
|
This item has no description. | |
| Published | property OnDblClick; |
|
This item has no description. | |
| Published | property Height; |
|
This item has no description. | |
| Published | property Width; |
|
This item has no description. | |
| Published | property Size; |
|
This item has no description. | |
| Published | property Position; |
|
This item has no description. | |
| Published | property Margins; |
|
This item has no description. | |
| Published | property TabStop default true; |
|
This item has no description. | |
| Published | property TabOrder; |
|
This item has no description. | |
| Published | property CanFocus default True; |
|
This item has no description. | |
Generated by PasDoc 1.0.4.