(AGK version: 108.24)
Submitted: 2015-10-12 09:16:21
Basic/universal buttons can, in addition to having their position and size controlled via SetButtonScreenPosition(), be manipulated with the virtual button commands and appear to use the first five of twelve "slots" available to virtual buttons. This is important as the buttons are otherwise indistinguishable. Further, the buttons will still not be visible on platforms that do not need them (for example, because a full keyboard is present).

// set display properties using percent-based locations
SetDisplayAspect(4.0/3.0)
SetOrientationAllowed( 1, 1, 1, 1 )

// put the spacebar button in the upper right corner,
// apply text and color the button
SetButtonScreenPosition(1, 94, 8, 7)
SetVirtualButtonText(1, "Space")
SetVirtualButtonColor(1, 190, 190, 63)

do
	// do something when the spacebar is pressed
	if GetButtonPressed(1) then SomeFunction()
	Sync()
loop
Help make AGK better by submitting an example for this command!
(All examples are subject to approval)
Login to post an example of your own.