method focus

void focus();

Argumente

Zurückgegebener Wert

This method will place the keyboard focus on this box. Setting the focus on one box will cause the currently focused box in the scene to lose focus.
function OnDriveCtrlClicked()
{
    var check = scene.getBoxById("driveCtrlBtn");
    var bx = scene.getBoxById("driveControl");
    if (check && bx)
    {
        if (check.toggled)
        {
            bx.hidden = false;
            bx.focus();
        }
        else
        {
            bx.hidden = true;
            bx.blur();
        }
    }
}