The 2D layer · interface
TextHost
Explained in Sprites and tilemaps.
interface TextHostimport type { TextHost } from '@driftengine/ui2d';Methods
focusField
focusField(x: number, y: number, w: number, h: number): voidTell the host a field is focused at this rectangle, so it can place a composition window.
| Parameter | Type | Description |
|---|---|---|
x | number | |
y | number | |
w | number | |
h | number |
blurField
blurField(): voidTell 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.
| Parameter | Type | Description |
|---|---|---|
text | string |