diff --git a/examples/ts_game/resources/tilemap_packed.png b/examples/ts_game/resources/tilemap_packed.png new file mode 100644 index 0000000..67e255f Binary files /dev/null and b/examples/ts_game/resources/tilemap_packed.png differ diff --git a/examples/ts_game/src/editor.ts b/examples/ts_game/src/editor.ts index 8a87920..31e9109 100644 --- a/examples/ts_game/src/editor.ts +++ b/examples/ts_game/src/editor.ts @@ -1,13 +1,14 @@ -import { Behaviour, Builder, Creator, Entity, HasBoundingBox, HasMouseInteraction, HasPosition, HasSize, combine, hasDefault, hasDefaultFn, makeEntity, which, withBoundingBox, withComponent, withMouseInteraction, withPosition, withSize } from "./entity" +import { Behaviour, Builder, Creator, Entity, HasBehaviour, HasBoundingBox, HasMouseInteraction, HasPosition, HasSize, combine, hasDefault, hasDefaultFn, makeEntity, which, withBehaviour, withBoundingBox, withComponent, withMouseInteraction, withPosition, withSize } from "./entity" import { entityAdd, gameRun, gameSetClearColor } from "./game" +import { resourceUnload, textureLoad } from "./resource" import { HasText, withText } from "./text" const withGuiSize = withComponent(x => hasDefaultFn(x, 'size', () => new Vector2(100,20))) type UiControl = Entity & HasPosition & HasSize -const makeControl = combine(makeEntity, withPosition, withSize) +const makeControl = combine(makeEntity, withPosition, withGuiSize) -type Button = Entity & HasPosition & HasSize & HasMouseInteraction & HasText +type Button = UiControl & HasMouseInteraction & HasText const drawsButton: Behaviour