diff --git a/examples/ts_game/.gitignore b/examples/ts_game/.gitignore index 7e9804b..bdc9544 100644 --- a/examples/ts_game/.gitignore +++ b/examples/ts_game/.gitignore @@ -1,2 +1,3 @@ node_modules/ -main.js \ No newline at end of file +main.js +editor.js \ No newline at end of file diff --git a/examples/ts_game/src/editor.ts b/examples/ts_game/src/editor.ts new file mode 100644 index 0000000..3a75603 --- /dev/null +++ b/examples/ts_game/src/editor.ts @@ -0,0 +1,58 @@ +import { Behaviour, Builder, Entity, HasBoundingBox, HasMouseInteraction, combine, hasDefault, hasDefaultFn, makeEntity, which, withBoundingBox, withComponent, withMouseInteraction } from "./entity" +import { entityAdd, runGame } from "./game" +import { HasText, withText } from "./text" + +const withGuiBounds = withComponent(x => hasDefaultFn(x, 'boundingBox', () => new Rectangle(10,10,100,20))) + +type Button = Entity & HasBoundingBox & HasMouseInteraction & HasText +const drawsButton: Behaviour