Skip to content

Commit

Permalink
chore: update make example (cherry-pick) (kaplayjs#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
lajbel authored Nov 2, 2024
1 parent 789920d commit 623339b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,17 @@ export interface KAPLAYCtx<
* @example
* ```js
* const label = make([
* text("oh hi"),
* ])
* add([
* rect(label.width, label.height),
* color(0, 0, 255),
* children(label),
* ])
* rect(100, 20),
* ]);
*
* // Add a new text to the label
* label.add([
* text("Hello, world!"),
* ]);
*
* // Add game object to the scene
* // Now it will render
* add(label);
* ```
*
* @group Game Obj
Expand Down

0 comments on commit 623339b

Please sign in to comment.