The 2D layer · interface

TextHost

Explained in Sprites and tilemaps.

interface TextHost
import type { TextHost } from '@driftengine/ui2d';

Methods

focusField

focusField(x: number, y: number, w: number, h: number): void

Tell the host a field is focused at this rectangle, so it can place a composition window.

ParameterTypeDescription
xnumber
ynumber
wnumber
hnumber

blurField

blurField(): void

Tell the host nothing is focused.

readClipboard

readClipboard(): Promise<string>

Read the clipboard, if the host has one. Asynchronous everywhere one exists.

writeClipboard

writeClipboard(text: string): Promise<void>

Write the clipboard, if the host has one.

ParameterTypeDescription
textstring