UIElement
Methods
click
public
Click UIElement.
Usage
const okButton = await ui.find(By.path('Object path'));
await gamium.wait(Until.elementInteractable(okButton));
await okButton.click();
Arguments
- options
Partial
<ActionsClickOptions
>
Returns
drag
public
Drag the UIElement.
Usage
const handle = await ui.find(By.path('Object path'));
await gamium.wait(Until.elementInteractable(handle));
await handle.drag(
{
x: handle.gameObject.info.screenPosition.x - 30,
y: handle.gameObject.info.screenPosition.y,
},
{ durationMs: 1000, intervalMs: 100 },
);
Arguments
options
Partial
<ActionsDragOptions
>
Returns
getText
public
Import text if it is a UIElement that has text.
Usage
const questObject = await ui.find(By.path('Object path'));
const progress = questObject.getText();
Returns
isInteractable
public
Verify that UIElement is interactive. To return to true, you must pass a number of conditions. Option allows you to override some conditions.
Usage
const okButton = await ui.find(By.path('Object path'));
const isInteractable = await okButton.isInteractable();
Arguments
- options
Partial
<QueryObjectInteractableOptions
>
Returns
refresh
public
Updates the information that the object has.
Usage
const okButton = await ui.find(By.path('Object path'));
await okButton.refresh();
Returns
scroll
public
Scroll by delta from UIElement.
Usage
const dragger = await ui.find(By.path('Object path'));
await gamium.wait(Until.elementInteractable(dragger));
await dragger.scroll({ x: 0, y: -0.5 }, { durationMs: 2000 });
Arguments
delta
Vector2
options
Partial
<ActionsScrollOptions
>
Returns
setText
public
Enter text in UIElement.
Usage
const text1 = await ui.find(By.path('Object path'));
await text1.setText('Hello World').perform();
Arguments
text
string
options
Returns
tryIsInteractable
public
Arguments
- options
Partial
<QueryObjectInteractableOptions
>
Returns
tryWaitInteractable
public
Arguments
- options
Partial
<QueryObjectInteractableOptions
>
Returns
waitInteractable
public
Wait for UIElement to interact..
Usage
const okButton = await ui.find(By.path('Object path'));
await okButton.waitInteractable();
Arguments
- options
Partial
<QueryObjectInteractableOptions
>