From c28bb915ffa1d8ea8f5d3e54c1ea5066239fe813 Mon Sep 17 00:00:00 2001 From: SGName <160347000+SG-SWE073@users.noreply.github.com> Date: Fri, 5 Apr 2024 22:51:46 -0400 Subject: [PATCH 1/3] docs(types.ts): add rotate() example --- src/types.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/types.ts b/src/types.ts index 810a8580..ac6b556e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -227,6 +227,18 @@ export interface KaboomCtx { scale(): ScaleComp, /** * Rotation (in degrees). + * + * @example + * ```js + * // bean WITH anchor: rotates bean based on sprite center + * // bean WITHOUT anchor: rotates bean relative to local space + * const rotateBean = add([ + * sprite("bean"), + * pos(200,140), + * anchor("center"), + * rotate(-90), + * ]) + * ``` */ rotate(a: number): RotateComp, /** From 052015799c55fc37cffed3052b5a2466602032bb Mon Sep 17 00:00:00 2001 From: SG-SWE073 <160347000+SG-SWE073@users.noreply.github.com> Date: Sun, 7 Apr 2024 12:44:26 -0400 Subject: [PATCH 2/3] Update types.ts - Changed variable name to "bean" - Added indents - Made comment description more clear --- src/types.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/types.ts b/src/types.ts index ac6b556e..aa0be827 100644 --- a/src/types.ts +++ b/src/types.ts @@ -230,13 +230,13 @@ export interface KaboomCtx { * * @example * ```js - * // bean WITH anchor: rotates bean based on sprite center - * // bean WITHOUT anchor: rotates bean relative to local space - * const rotateBean = add([ - * sprite("bean"), - * pos(200,140), - * anchor("center"), - * rotate(-90), + * // rotate() WITH anchor("center"): rotates bean based on sprite's center, and won't move bean's position on rotation + * // rotate() WITHOUT anchor("center"): rotates bean based on default anchor that is top left, moving bean's position slightly on rotation + * const bean = add([ + * sprite("bean"), + * pos(200,140), + * anchor("center"), + * rotate(-90), * ]) * ``` */ From b2aae8f6ba0bb88bd34222d74e03f3cceb6c17c5 Mon Sep 17 00:00:00 2001 From: SG-SWE073 <160347000+SG-SWE073@users.noreply.github.com> Date: Tue, 9 Apr 2024 11:02:26 -0400 Subject: [PATCH 3/3] lowercase words and update desc types.ts - Made "with" and "without" lowercase - Changed the description again --- src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types.ts b/src/types.ts index aa0be827..e79f7d14 100644 --- a/src/types.ts +++ b/src/types.ts @@ -230,8 +230,8 @@ export interface KaboomCtx { * * @example * ```js - * // rotate() WITH anchor("center"): rotates bean based on sprite's center, and won't move bean's position on rotation - * // rotate() WITHOUT anchor("center"): rotates bean based on default anchor that is top left, moving bean's position slightly on rotation + * // rotate() with anchor("center"): will rotate based on sprite's center, and won't move bean's position on rotation + * // rotate() without anchor("center"): will rotate based on the sprite anchor (by default, topleft), moving bean's position slightly on rotation * const bean = add([ * sprite("bean"), * pos(200,140),