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 161).

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

This item has no description.

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

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

This item has no description.

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

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

This item has no description.

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

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

This item has no description.

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

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

This item has no description.

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

Protected function DefinePresentationName: String; override;

This item has no description.

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

Protected procedure Resize; override;

This item has no description.

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

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

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

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

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

This item has no description.

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

Public constructor Create(AOwner: TComponent); override;

This item has no description.

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

Public destructor Destroy; override;

This item has no description.

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

Public procedure Paint; override;

This item has no description.

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

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 194).

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 205).

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 229).

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 239).

Properties

Public property ControlType default DefaultControlType;

This item has no description.

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

Published property Container: TCastleControlContainer read GetContainer;

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

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

Published property Align;

This item has no description.

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

Published property Anchors;

This item has no description.

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

Published property OnClick;

This item has no description.

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

Published property OnDblClick;

This item has no description.

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

Published property Height;

This item has no description.

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

Published property Width;

This item has no description.

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

Published property Size;

This item has no description.

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

Published property Position;

This item has no description.

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

Published property Margins;

This item has no description.

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

Published property TabStop default true;

This item has no description.

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

Published property TabOrder;

This item has no description.

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

Published property CanFocus default True;

This item has no description.

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


Generated by PasDoc 1.0.4.