Class TCastleRectangleControl
Unit
Declaration
type TCastleRectangleControl = class(TCastleUserInterface)
Description
Fill a rectangle on screen with given color or theme image.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleUserInterface
- TCastleRectangleControl
Overview
Methods
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
procedure Render; override; |
|
function Press(const Event: TInputPressRelease): boolean; override; |
|
function Release(const Event: TInputPressRelease): boolean; override; |
|
function Motion(const Event: TInputMotion): boolean; override; |
|
function PropertySections(const PropertyName: String): TPropertySections; override; |
Properties
property Color: TCastleColor read FColor write SetColor; |
|
property ThemeImage: TThemeImage read FThemeImage write SetThemeImage; deprecated 'use TCastleImageControl to display images'; |
|
property UseThemeImage: boolean read FUseThemeImage write SetUseThemeImage default false; deprecated 'use TCastleImageControl to display images'; |
|
property InterceptInput: boolean read FInterceptInput write FInterceptInput
default false; deprecated 'in each case, there should be a cleaner way to disable something from processing the input'; |
|
property ColorPersistent: TCastleColorPersistent read FColorPersistent ; |
Description
Methods
constructor Create(AOwner: TComponent); override; |
|
This item has no description. |
destructor Destroy; override; |
|
This item has no description. |
procedure Render; override; |
|
This item has no description. Showing description inherited from TCastleUserInterface.Render. Render a control. Called only when Exists and render context is initialized. Do not call this method. It will be automatically called by the engine when needed. It will be called when UI is part of TCastleContainer.Controls list or rendered (e.g. for off-screen rendering) by TCastleContainer.RenderControl. You should only override this method. See https://castle-engine.io/manual_2d_ui_custom_drawn.php for examples what you can put here. You can depend on some OpenGL state being set before calling this method. You can depend on it being set, and you can carelessly change it. This state we set:
Beware that GLSL RenderContext.CurrentProgram has undefined value when this is called. You should always set it, before making direct OpenGL drawing calls (all the engine drawing routines do it already, this is only a concern if you make direct OpenGL / OpenGLES calls). |
function Press(const Event: TInputPressRelease): boolean; override; |
|
This item has no description. Showing description inherited from TCastleUserInterface.Press.
Override this method to react to user pressing a key, mouse button or mouse wheel. Return When implementing in descendants it is best to override it like this: function TMyControl.Press(const Event: TInputPressRelease): boolean; begin Result := inherited; if Result then Exit; // exit if ancestor already handled this event if Event.IsKey(keyEnter) then begin // do something in reaction to Enter key ... // let engine know that this input event was handled Exit(true); end; if Event.IsMouseButton(buttonLeft) then begin // do something in reaction to left mouse button press ... // let engine know that this input event was handled Exit(true); end; end;
These events are generated for all UI controls, whether they are considered "interactive" or not. These events are generated for non-interactive controls like TCastleRectangleControl or TCastleLabel as well. For example, these events ignore the TCastleButton.Enabled state, they are generated always (see https://github.com/castle-engine/castle-engine/issues/413 ). Use instead TCastleButton.OnClick to detect clicks on a button in a way that honors the TCastleButton.Enabled state. When a control returns The events Press and Release are passed to the parent only after the children had a chance to process this event. Overriding them makes sense if you draw something that "looks clickable" in TCastleUserInterface.Render, which is the standard place you should draw stuff. For example our TCastleButton draws there. In contrast, the events PreviewPress and PreviewRelease are passed first to the parent control, before children have a chance to process this event. In partcular, overriding them makes sense if you draw something that "looks clickable" in TCastleUserInterface.RenderOverChildren. |
function Release(const Event: TInputPressRelease): boolean; override; |
|
This item has no description. Showing description inherited from TCastleUserInterface.Release.
Override this method to react to user releasing a key, mouse button. Return This is counterpart to Press method. See Press for more details. Note: We'd like this method to also be called when user releases a mouse wheel. But currently releasing of the mouse wheel is not reported now by any backend. Only releasing of keys and mouse buttons is reported. |
function Motion(const Event: TInputMotion): boolean; override; |
|
This item has no description. Showing description inherited from TCastleUserInterface.Motion.
|
function PropertySections(const PropertyName: String): TPropertySections; override; |
|
This item has no description. Showing description inherited from TCastleComponent.PropertySections. Section where to show property in the editor. |
Properties
property Color: TCastleColor read FColor write SetColor; |
|
Rectangle color. By default, opaque white. |
property ThemeImage: TThemeImage read FThemeImage write SetThemeImage; deprecated 'use TCastleImageControl to display images'; |
|
Warning: this symbol is deprecated: use TCastleImageControl to display images Fill rectangle with theme image. You have to set UseThemeImage to true to take effect. |
property InterceptInput: boolean read FInterceptInput write FInterceptInput
default false; deprecated 'in each case, there should be a cleaner way to disable something from processing the input'; |
|
Warning: this symbol is deprecated: in each case, there should be a cleaner way to disable something from processing the input
Prevents passing mouse/keyboard events to the controls underneath. More precisely, when this property is |
property ColorPersistent: TCastleColorPersistent read FColorPersistent ; |
|
Color that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write Color directly. See also
|
Generated by PasDoc 0.16.0-snapshot.