From fef5ad92a5251702f8e18271ea8f5bb0a9e84c61 Mon Sep 17 00:00:00 2001 From: tga Date: Thu, 16 Nov 2023 00:44:03 +0800 Subject: [PATCH] improve doc --- src/types.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index e55194dc9..1b6532f9c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -4249,7 +4249,17 @@ export interface Collision { export interface AreaCompOpt { /** - * The shape of the area. + * The shape of the area (currently only Rect and Polygon is supported). + * + * @example + * ```js + * add([ + * sprite("butterfly"), + * pos(100, 200), + * // a triangle shape! + * area({ shape: new Polygon([vec2(0), vec2(100), vec2(-100, 100)]) }), + * ]) + * ``` */ shape?: Shape, /**