Skip to content

Tego Bot API Documentation v0.2.0


Tego Bot API Documentation / imageResourceSync

Function: imageResourceSync() ​

imageResourceSync(path): ImageResource

Defined in: botjs/src/image-match.ts:141

Load an image synchronously from file for use as a template

Parameters ​

path ​

string

Path to the image file (PNG, JPG, BMP, etc.)

Returns ​

ImageResource

ImageResource

Example ​

typescript
import { imageResourceSync, findOnScreen } from "@tego/botjs";

const icon = imageResourceSync("./assets/icon.png");
const match = await findOnScreen(icon);

Released under the MIT License.