@hi-ashleyj/llama 0.13.2 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Game.svelte +154 -129
- package/dist/Game.svelte.d.ts +10 -21
- package/dist/Layer.svelte +61 -46
- package/dist/Layer.svelte.d.ts +9 -20
- package/dist/audio/AudioCompressor.svelte +70 -44
- package/dist/audio/AudioCompressor.svelte.d.ts +14 -23
- package/dist/audio/AudioGain.svelte +33 -20
- package/dist/audio/AudioGain.svelte.d.ts +6 -17
- package/dist/audio/AudioListenerPosition.svelte +79 -93
- package/dist/audio/AudioListenerPosition.svelte.d.ts +6 -16
- package/dist/audio/AudioPanner.svelte +33 -20
- package/dist/audio/AudioPanner.svelte.d.ts +6 -17
- package/dist/audio/BufferedAudioSource.svelte +59 -44
- package/dist/audio/BufferedAudioSource.svelte.d.ts +8 -18
- package/dist/audio/MediaAudioSource.svelte +56 -35
- package/dist/audio/MediaAudioSource.svelte.d.ts +13 -25
- package/dist/audio/context.d.ts +1 -1
- package/dist/controllers/MouseClickable.svelte +61 -49
- package/dist/controllers/MouseClickable.svelte.d.ts +11 -20
- package/dist/controllers/MouseEventArea.svelte +71 -55
- package/dist/controllers/MouseEventArea.svelte.d.ts +13 -26
- package/dist/controllers/motions.d.ts +4 -5
- package/dist/drawables/Arc.svelte +48 -30
- package/dist/drawables/Arc.svelte.d.ts +9 -19
- package/dist/drawables/Circle.svelte +38 -24
- package/dist/drawables/Circle.svelte.d.ts +7 -17
- package/dist/drawables/DisplayImage.svelte +26 -16
- package/dist/drawables/DisplayImage.svelte.d.ts +11 -21
- package/dist/drawables/MultiLineText.svelte +75 -45
- package/dist/drawables/MultiLineText.svelte.d.ts +14 -24
- package/dist/drawables/Rectangle.svelte +35 -22
- package/dist/drawables/Rectangle.svelte.d.ts +7 -17
- package/dist/drawables/RoundedRectangle.svelte +41 -23
- package/dist/drawables/RoundedRectangle.svelte.d.ts +8 -18
- package/dist/drawables/Text.svelte +63 -40
- package/dist/drawables/Text.svelte.d.ts +13 -23
- package/dist/drawables/Tiled.svelte +79 -61
- package/dist/drawables/Tiled.svelte.d.ts +10 -20
- package/dist/extras/DefaultFontFace.svelte +35 -17
- package/dist/extras/DefaultFontFace.svelte.d.ts +15 -24
- package/dist/extras/FullScreenEventHandler.svelte +37 -23
- package/dist/extras/FullScreenEventHandler.svelte.d.ts +9 -19
- package/dist/extras/LayerPortal.svelte +36 -22
- package/dist/extras/LayerPortal.svelte.d.ts +6 -17
- package/dist/extras/SensibleDefaultStyles.svelte +8 -2
- package/dist/extras/SensibleDefaultStyles.svelte.d.ts +5 -17
- package/dist/extras/Tweened.svelte +28 -9
- package/dist/extras/Tweened.svelte.d.ts +12 -22
- package/dist/primitives/Area.svelte +46 -22
- package/dist/primitives/Area.svelte.d.ts +14 -24
- package/dist/primitives/Empty.svelte +7 -2
- package/dist/primitives/Empty.svelte.d.ts +5 -15
- package/dist/primitives/Inset.svelte +45 -26
- package/dist/primitives/Inset.svelte.d.ts +9 -20
- package/dist/primitives/Node.svelte +32 -19
- package/dist/primitives/Node.svelte.d.ts +7 -18
- package/dist/primitives/Opacity.svelte +34 -22
- package/dist/primitives/Opacity.svelte.d.ts +6 -17
- package/dist/primitives/Rotate.svelte +33 -22
- package/dist/primitives/Rotate.svelte.d.ts +11 -21
- package/dist/primitives/Translate.svelte +32 -19
- package/dist/primitives/Translate.svelte.d.ts +7 -18
- package/dist/resources/AssetPool.svelte +7 -2
- package/dist/resources/AssetPool.svelte.d.ts +5 -15
- package/dist/resources/AudioBufferedAsset.svelte +14 -6
- package/dist/resources/AudioBufferedAsset.svelte.d.ts +5 -15
- package/dist/resources/AudioMediaAsset.svelte +10 -2
- package/dist/resources/AudioMediaAsset.svelte.d.ts +5 -15
- package/dist/resources/ImageAsset.svelte +16 -9
- package/dist/resources/ImageAsset.svelte.d.ts +5 -15
- package/dist/resources/audio.d.ts +1 -1
- package/dist/resources/images.d.ts +1 -1
- package/dist/scenes/SceneSwitcher.svelte +27 -16
- package/dist/scenes/SceneSwitcher.svelte.d.ts +5 -16
- package/dist/scenes/SceneTransition.svelte +47 -36
- package/dist/scenes/SceneTransition.svelte.d.ts +6 -20
- package/package.json +10 -9
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
bottom?: number | undefined;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {
|
|
13
|
-
default: {};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export type InsetProps = typeof __propDef.props;
|
|
17
|
-
export type InsetEvents = typeof __propDef.events;
|
|
18
|
-
export type InsetSlots = typeof __propDef.slots;
|
|
19
|
-
export default class Inset extends SvelteComponent<InsetProps, InsetEvents, InsetSlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
left?: number;
|
|
3
|
+
right?: number;
|
|
4
|
+
top?: number;
|
|
5
|
+
bottom?: number;
|
|
6
|
+
children?: import('svelte').Snippet;
|
|
20
7
|
}
|
|
21
|
-
|
|
8
|
+
declare const Inset: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type Inset = ReturnType<typeof Inset>;
|
|
10
|
+
export default Inset;
|
|
@@ -1,22 +1,35 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
|
|
3
|
+
import { setupDrawable, type DrawFunction } from "../drawable.js";
|
|
4
|
+
import { onMount } from "svelte";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
children?: import('svelte').Snippet;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let { x, y, children }: Props = $props();
|
|
13
|
+
|
|
14
|
+
const targets = new Set<{ draw: DrawFunction<{x: number, y: number}> }>();
|
|
15
|
+
|
|
16
|
+
const draw: DrawFunction<null> = function ( { width, height, ctx } ) {
|
|
17
|
+
targets.forEach(f => f.draw({ width, height, ctx }, { x, y }));
|
|
14
18
|
};
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
let register = setupDrawable<null, {x: number, y: number}>({
|
|
21
|
+
assign: (ctx) => {
|
|
22
|
+
targets.add(ctx);
|
|
23
|
+
return () => {
|
|
24
|
+
targets.delete(ctx);
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
onMount(() => {
|
|
30
|
+
return register({ draw });
|
|
31
|
+
});
|
|
32
|
+
|
|
20
33
|
</script>
|
|
21
34
|
|
|
22
|
-
|
|
35
|
+
{@render children?.()}
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
y: number;
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {
|
|
11
|
-
default: {};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type NodeProps = typeof __propDef.props;
|
|
15
|
-
export type NodeEvents = typeof __propDef.events;
|
|
16
|
-
export type NodeSlots = typeof __propDef.slots;
|
|
17
|
-
export default class Node extends SvelteComponent<NodeProps, NodeEvents, NodeSlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
children?: import('svelte').Snippet;
|
|
18
5
|
}
|
|
19
|
-
|
|
6
|
+
declare const Node: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type Node = ReturnType<typeof Node>;
|
|
8
|
+
export default Node;
|
|
@@ -1,25 +1,37 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
|
|
3
|
+
import { setupDrawable, type DrawFunction } from "../drawable.js";
|
|
4
|
+
import { onMount } from "svelte";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
opacity: number;
|
|
8
|
+
children?: import('svelte').Snippet;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { opacity, children }: Props = $props();
|
|
12
|
+
|
|
13
|
+
const targets = new Set<{ draw: DrawFunction<unknown> }>();
|
|
14
|
+
|
|
15
|
+
const draw: DrawFunction<unknown> = function ( { width, height, ctx }, offset ) {
|
|
16
|
+
if (opacity <= 0) return;
|
|
17
|
+
ctx.globalAlpha = Math.min(opacity, 1);
|
|
18
|
+
targets.forEach(f => f.draw({ width, height, ctx }, offset));
|
|
19
|
+
ctx.globalAlpha = 1;
|
|
17
20
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
|
|
22
|
+
let register = setupDrawable<unknown, unknown>({
|
|
23
|
+
assign: (ctx) => {
|
|
24
|
+
targets.add(ctx);
|
|
25
|
+
return () => {
|
|
26
|
+
targets.delete(ctx);
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
onMount(() => {
|
|
32
|
+
return register({ draw });
|
|
33
|
+
});
|
|
34
|
+
|
|
23
35
|
</script>
|
|
24
36
|
|
|
25
|
-
|
|
37
|
+
{@render children?.()}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
opacity: number;
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {
|
|
10
|
-
default: {};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export type OpacityProps = typeof __propDef.props;
|
|
14
|
-
export type OpacityEvents = typeof __propDef.events;
|
|
15
|
-
export type OpacitySlots = typeof __propDef.slots;
|
|
16
|
-
export default class Opacity extends SvelteComponent<OpacityProps, OpacityEvents, OpacitySlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
opacity: number;
|
|
3
|
+
children?: import('svelte').Snippet;
|
|
17
4
|
}
|
|
18
|
-
|
|
5
|
+
declare const Opacity: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type Opacity = ReturnType<typeof Opacity>;
|
|
7
|
+
export default Opacity;
|
|
@@ -1,25 +1,36 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { setupDrawable, type DrawFunction } from "../drawable.js";
|
|
3
|
+
import { onMount } from "svelte";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
/**
|
|
7
|
+
* FALSE = ANCHOR TOP LEFT
|
|
8
|
+
* TRUE = ANCHOR CENTER
|
|
9
|
+
*/
|
|
10
|
+
centered?: boolean;
|
|
11
|
+
degrees: number;
|
|
12
|
+
children?: import('svelte').Snippet;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let { centered = false, degrees, children }: Props = $props();
|
|
16
|
+
const targets = new Set<{ draw: DrawFunction<{ x: number, y: number, w: number, h: number }> }>();
|
|
17
|
+
const draw: DrawFunction<{ x: number, y: number, w: number, h: number }> = function ( { width, height, ctx }, { x, y, w, h} ) {
|
|
18
|
+
ctx.translate(x, y);
|
|
19
|
+
ctx.rotate(degrees * Math.PI / 180 )
|
|
20
|
+
targets.forEach(f => f.draw({ width, height, ctx }, { x: (centered) ? w * -0.5 : 0, y: (centered) ? h * -0.5 : 0, w, h }));
|
|
21
|
+
ctx.resetTransform();
|
|
17
22
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
let register = setupDrawable<{ x: number, y: number, w: number, h: number }, { x: number, y: number, w: number, h: number }>({
|
|
24
|
+
assign: (ctx) => {
|
|
25
|
+
targets.add(ctx);
|
|
26
|
+
return () => {
|
|
27
|
+
targets.delete(ctx);
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
onMount(() => {
|
|
32
|
+
return register({ draw });
|
|
33
|
+
});
|
|
23
34
|
</script>
|
|
24
35
|
|
|
25
|
-
|
|
36
|
+
{@render children?.()}
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
events: {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
};
|
|
13
|
-
slots: {
|
|
14
|
-
default: {};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export type RotateProps = typeof __propDef.props;
|
|
18
|
-
export type RotateEvents = typeof __propDef.events;
|
|
19
|
-
export type RotateSlots = typeof __propDef.slots;
|
|
20
|
-
export default class Rotate extends SvelteComponent<RotateProps, RotateEvents, RotateSlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
/**
|
|
3
|
+
* FALSE = ANCHOR TOP LEFT
|
|
4
|
+
* TRUE = ANCHOR CENTER
|
|
5
|
+
*/
|
|
6
|
+
centered?: boolean;
|
|
7
|
+
degrees: number;
|
|
8
|
+
children?: import('svelte').Snippet;
|
|
21
9
|
}
|
|
22
|
-
|
|
10
|
+
declare const Rotate: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type Rotate = ReturnType<typeof Rotate>;
|
|
12
|
+
export default Rotate;
|
|
@@ -1,22 +1,35 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
|
|
3
|
+
import { setupDrawable, type DrawFunction } from "../drawable.js";
|
|
4
|
+
import { onMount } from "svelte";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
children?: import('svelte').Snippet;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let { x, y, children }: Props = $props();
|
|
13
|
+
|
|
14
|
+
const targets = new Set<{ draw: DrawFunction<{x: number, y: number}> }>();
|
|
15
|
+
|
|
16
|
+
const draw: DrawFunction<{x: number, y: number}> = function ( { width, height, ctx }, offset ) {
|
|
17
|
+
targets.forEach(f => f.draw({ width, height, ctx }, { x: offset.x + x, y: offset.y + y }));
|
|
14
18
|
};
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
let register = setupDrawable<{x: number, y: number}, {x: number, y: number}>({
|
|
21
|
+
assign: (ctx) => {
|
|
22
|
+
targets.add(ctx);
|
|
23
|
+
return () => {
|
|
24
|
+
targets.delete(ctx);
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
onMount(() => {
|
|
30
|
+
return register({ draw });
|
|
31
|
+
});
|
|
32
|
+
|
|
20
33
|
</script>
|
|
21
34
|
|
|
22
|
-
|
|
35
|
+
{@render children?.()}
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
y: number;
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {
|
|
11
|
-
default: {};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type TranslateProps = typeof __propDef.props;
|
|
15
|
-
export type TranslateEvents = typeof __propDef.events;
|
|
16
|
-
export type TranslateSlots = typeof __propDef.slots;
|
|
17
|
-
export default class Translate extends SvelteComponent<TranslateProps, TranslateEvents, TranslateSlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
children?: import('svelte').Snippet;
|
|
18
5
|
}
|
|
19
|
-
|
|
6
|
+
declare const Translate: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type Translate = ReturnType<typeof Translate>;
|
|
8
|
+
export default Translate;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
props: Record<string, never>;
|
|
4
|
-
events: {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
};
|
|
7
|
-
slots: {
|
|
8
|
-
default: {};
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export type AssetPoolProps = typeof __propDef.props;
|
|
12
|
-
export type AssetPoolEvents = typeof __propDef.events;
|
|
13
|
-
export type AssetPoolSlots = typeof __propDef.slots;
|
|
14
|
-
export default class AssetPool extends SvelteComponent<AssetPoolProps, AssetPoolEvents, AssetPoolSlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
children?: import('svelte').Snippet;
|
|
15
3
|
}
|
|
16
|
-
|
|
4
|
+
declare const AssetPool: import("svelte").Component<Props, {}, "">;
|
|
5
|
+
type AssetPool = ReturnType<typeof AssetPool>;
|
|
6
|
+
export default AssetPool;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from "svelte";
|
|
3
|
+
import { pushBufferAsset } from "./audio.js";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
url: any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { url }: Props = $props();
|
|
10
|
+
|
|
11
|
+
onMount(() => {
|
|
12
|
+
pushBufferAsset(url);
|
|
13
|
+
})
|
|
14
|
+
|
|
7
15
|
</script>
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
props: {
|
|
4
|
-
url: any;
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
};
|
|
11
|
-
export type AudioBufferedAssetProps = typeof __propDef.props;
|
|
12
|
-
export type AudioBufferedAssetEvents = typeof __propDef.events;
|
|
13
|
-
export type AudioBufferedAssetSlots = typeof __propDef.slots;
|
|
14
|
-
export default class AudioBufferedAsset extends SvelteComponent<AudioBufferedAssetProps, AudioBufferedAssetEvents, AudioBufferedAssetSlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
url: any;
|
|
15
3
|
}
|
|
16
|
-
|
|
4
|
+
declare const AudioBufferedAsset: import("svelte").Component<Props, {}, "">;
|
|
5
|
+
type AudioBufferedAsset = ReturnType<typeof AudioBufferedAsset>;
|
|
6
|
+
export default AudioBufferedAsset;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
|
|
3
|
+
// this component is stupid as audio media sources don't re-use the asset - this only preloads the asset.0
|
|
4
|
+
interface Props {
|
|
5
|
+
url: any;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
let { url }: Props = $props();
|
|
9
|
+
|
|
2
10
|
</script>
|
|
3
11
|
|
|
4
|
-
<audio src={url} muted preload="auto"
|
|
12
|
+
<audio src={url} muted preload="auto"></audio>
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
props: {
|
|
4
|
-
url: any;
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
};
|
|
11
|
-
export type AudioMediaAssetProps = typeof __propDef.props;
|
|
12
|
-
export type AudioMediaAssetEvents = typeof __propDef.events;
|
|
13
|
-
export type AudioMediaAssetSlots = typeof __propDef.slots;
|
|
14
|
-
export default class AudioMediaAsset extends SvelteComponent<AudioMediaAssetProps, AudioMediaAssetEvents, AudioMediaAssetSlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
url: any;
|
|
15
3
|
}
|
|
16
|
-
|
|
4
|
+
declare const AudioMediaAsset: import("svelte").Component<Props, {}, "">;
|
|
5
|
+
type AudioMediaAsset = ReturnType<typeof AudioMediaAsset>;
|
|
6
|
+
export default AudioMediaAsset;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
|
|
3
|
+
import {pushAsset} from "./images.js";
|
|
4
|
+
import { onMount } from "svelte";
|
|
5
|
+
interface Props {
|
|
6
|
+
url: any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { url }: Props = $props();
|
|
10
|
+
let element = $state();
|
|
11
|
+
|
|
12
|
+
onMount(() => {
|
|
13
|
+
if (!element) return;
|
|
14
|
+
pushAsset(url, element);
|
|
15
|
+
})
|
|
16
|
+
|
|
10
17
|
</script>
|
|
11
18
|
|
|
12
19
|
<img src={url} alt="A Game Asset" bind:this={element} />
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
props: {
|
|
4
|
-
url: any;
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
};
|
|
11
|
-
export type ImageAssetProps = typeof __propDef.props;
|
|
12
|
-
export type ImageAssetEvents = typeof __propDef.events;
|
|
13
|
-
export type ImageAssetSlots = typeof __propDef.slots;
|
|
14
|
-
export default class ImageAsset extends SvelteComponent<ImageAssetProps, ImageAssetEvents, ImageAssetSlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
url: any;
|
|
15
3
|
}
|
|
16
|
-
|
|
4
|
+
declare const ImageAsset: import("svelte").Component<Props, {}, "">;
|
|
5
|
+
type ImageAsset = ReturnType<typeof ImageAsset>;
|
|
6
|
+
export default ImageAsset;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const pushBufferAsset: (url: string) => void;
|
|
2
2
|
export declare const decodeAllBuffers: (context: AudioContext) => void;
|
|
3
|
-
export declare const resolveBuffer: (url: string) => Promise<
|
|
3
|
+
export declare const resolveBuffer: (url: string) => Promise<any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const pushAsset: (url: string, element: HTMLImageElement) => void;
|
|
2
|
-
export declare const resolve: (url: string) =>
|
|
2
|
+
export declare const resolve: (url: string) => any;
|
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
|
|
3
|
+
import {jumpSignal, effectiveScene} from "./scenes.js";
|
|
4
|
+
import {SvelteComponent, onMount} from "svelte";
|
|
5
|
+
import {getTriggerLayerRender} from "../core-contexts.js";
|
|
6
|
+
|
|
7
|
+
const triggerRender = getTriggerLayerRender();
|
|
8
|
+
let scene: string = $state();
|
|
9
|
+
const changeScene = (_signal: boolean) => {
|
|
10
|
+
scene = $effectiveScene;
|
|
11
|
+
triggerRender();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
$effect(() => changeScene($jumpSignal));
|
|
15
|
+
|
|
16
|
+
onMount(() => {
|
|
17
|
+
scene = $effectiveScene;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
interface Props {
|
|
21
|
+
scenes?: Record<string, typeof SvelteComponent<any,any,any>>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let { scenes = {} }: Props = $props();
|
|
25
|
+
|
|
16
26
|
</script>
|
|
17
27
|
|
|
18
28
|
{#if scene && scenes[scene]}
|
|
19
|
-
|
|
29
|
+
{@const SvelteComponent_1 = scenes[scene]}
|
|
30
|
+
<SvelteComponent_1 />
|
|
20
31
|
{/if}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
scenes?: Record<string, {
|
|
5
|
-
new (options: import("svelte").ComponentConstructorOptions<any>): SvelteComponent<any, any, any>;
|
|
6
|
-
}> | undefined;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
12
|
-
};
|
|
13
|
-
export type SceneSwitcherProps = typeof __propDef.props;
|
|
14
|
-
export type SceneSwitcherEvents = typeof __propDef.events;
|
|
15
|
-
export type SceneSwitcherSlots = typeof __propDef.slots;
|
|
16
|
-
export default class SceneSwitcher extends SvelteComponent<SceneSwitcherProps, SceneSwitcherEvents, SceneSwitcherSlots> {
|
|
2
|
+
interface Props {
|
|
3
|
+
scenes?: Record<string, typeof SvelteComponent<any, any, any>>;
|
|
17
4
|
}
|
|
18
|
-
|
|
5
|
+
declare const SceneSwitcher: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type SceneSwitcher = ReturnType<typeof SceneSwitcher>;
|
|
7
|
+
export default SceneSwitcher;
|