AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkVirtualButton.Create Constructor (TAgkObject, Single, Single, Single)

Creates an on-screen button that can be controlled by a touch screen, mouse, or other pointer device.

Syntax
Pascal
constructor Create(const Owner: TAgkObject; const X: Single; const Y: Single; const Size: Single); overload;
Parameters 
Description 
const Owner: TAgkObject 
the owner of the virtual button (eg. a TAgkScene object). 
const X: Single 
The X position of the center of the button in screen coordinates. 
const Y: Single 
The Y position of the center of the button in screen coordinates. 
const Size: Single 
The diameter of the button in screen coordinates. 

These are separate to physical joystick buttons or keyboard keys. You may have up to 12 virtual buttons on screen at the same time. Creating a 13th virtual button will raise an exception. 

If a virtual button is on screen and is clicked or touched the button will capture that event and TAgkRawMouse.LeftDown will return 0 (up), and a touch event will not be generated for that action. 

TAgkVirtualButton

Copyright (c) 2012. All rights reserved.