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
Show Additional Members:

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.

Source: delphi/fmx.castlecontrol.pas (line 140).

Protected procedure MouseMove(Shift: TShiftState; NewX, NewY: Single); override;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 142).

Protected procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 143).

Protected procedure MouseWheel(Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean); override;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 145).

Protected procedure KeyDown(var Key: Word; var KeyChar: WideChar; Shift: TShiftState); override;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 146).

Protected procedure KeyUp(var Key: Word; var KeyChar: WideChar; Shift: TShiftState); override;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 147).

Protected function DefinePresentationName: String; override;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 148).

Protected procedure Resize; override;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 149).

Protected procedure DoRootChanging(const NewRoot: IRoot); override;

Not needed in the end // procedure DoRootChanged; override;

Source: delphi/fmx.castlecontrol.pas (line 151).

Protected procedure SetVisible(const AValue: Boolean); override;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 152).

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 154).

Public destructor Destroy; override;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 155).

Public procedure Paint; override;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 156).

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.

Source: delphi/fmx.castlecontrol.pas (line 173).

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.

Source: delphi/fmx.castlecontrol.pas (line 184).

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.

Source: delphi/fmx.castlecontrol.pas (line 208).

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.

Source: delphi/fmx.castlecontrol.pas (line 218).

Properties

Public property ControlType default DefaultControlType;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 193).

Published property Container: TCastleControlContainer read GetContainer;

Access Castle Game Engine container properties and events, not specific to FMX.

Source: delphi/fmx.castlecontrol.pas (line 222).

Published property Align;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 224).

Published property Anchors;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 225).

Published property OnClick;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 226).

Published property OnDblClick;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 227).

Published property Height;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 228).

Published property Width;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 229).

Published property Size;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 230).

Published property Position;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 231).

Published property Margins;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 232).

Published property TabStop default true;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 233).

Published property TabOrder;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 234).

Published property CanFocus default True;

This item has no description.

Source: delphi/fmx.castlecontrol.pas (line 235).


Generated by PasDoc 1.0.4.