Skip to content

Commit

Permalink
chore(types.ts): add scale() examples in docs (#832)
Browse files Browse the repository at this point in the history
  • Loading branch information
SG-SWE073 committed Mar 23, 2024
1 parent 11b85f2 commit 7884c6b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,26 @@ export interface KaboomCtx {
scale(x: number, y: number): ScaleComp,
scale(xy: number): ScaleComp,
scale(s: Vec2): ScaleComp,
/**
* Scale the game obj.
*
* @example
* ```js
* // scale uniformly with one value
* add([
* sprite("bean"),
* scale(3),
* ])
* // scale with x & y values. In this case, scales more horizontally.
* add([
* sprite("bean"),
* scale(3, 1),
* ])
* // scale with vec2(x,y).
* bean.scale = vec2(2,4)
*
* ```
*/
scale(): ScaleComp,
/**
* Rotation (in degrees).
Expand Down

0 comments on commit 7884c6b

Please sign in to comment.