@dcl/playground-assets 7.0.6-4153633895.commit-4aad233 → 7.0.6-4180146485.commit-9a7dde9
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/alpha.d.ts +244 -149
- package/dist/beta.d.ts +244 -149
- package/dist/index.bundled.d.ts +244 -149
- package/dist/index.js +411 -199
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/playground/sdk/dcl-sdk.package.json +3 -3
- package/dist/playground/snippets/ui-backgrounds.tsx +5 -26
- package/dist/playground/snippets/ui.tsx +4 -21
- package/dist/playground-assets.d.ts +244 -149
- package/etc/playground-assets.api.json +2105 -1647
- package/etc/playground-assets.api.md +132 -92
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/sdk",
|
|
3
|
-
"version": "7.0.6-
|
|
3
|
+
"version": "7.0.6-4180146485.commit-9a7dde9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"typings": "./index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@dcl/dcl-rollup": "file:../dcl-rollup",
|
|
24
24
|
"@dcl/ecs": "file:../ecs",
|
|
25
25
|
"@dcl/ecs-math": "2.0.1-20221129185242.commit-40495c1",
|
|
26
|
-
"@dcl/explorer": "1.0.
|
|
26
|
+
"@dcl/explorer": "1.0.81966-20230215010724.commit-64eb73f",
|
|
27
27
|
"@dcl/js-runtime": "file:../js-runtime",
|
|
28
28
|
"@dcl/mini-comms": "1.0.0",
|
|
29
29
|
"@dcl/protocol": "1.0.0-4114477251.commit-ccb88d6",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"displayName": "SDK",
|
|
58
58
|
"tsconfig": "./tsconfig.json"
|
|
59
59
|
},
|
|
60
|
-
"commit": "
|
|
60
|
+
"commit": "9a7dde903f381c1778ec3c7519e4f312ab9b2ee3"
|
|
61
61
|
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { engine } from '@dcl/sdk/ecs'
|
|
2
2
|
import { Color4 } from '@dcl/sdk/math'
|
|
3
|
-
import ReactEcs, {
|
|
4
|
-
UiEntity,
|
|
5
|
-
Label,
|
|
6
|
-
ReactEcsRenderer,
|
|
7
|
-
Dropdown
|
|
8
|
-
} from '@dcl/sdk/react-ecs'
|
|
3
|
+
import ReactEcs, { UiEntity, Label, ReactEcsRenderer, Dropdown } from '@dcl/sdk/react-ecs'
|
|
9
4
|
|
|
10
5
|
type GenesisPlazaContent = string
|
|
11
6
|
const src: GenesisPlazaContent = 'images/rounded_alpha_square.png'
|
|
@@ -21,11 +16,7 @@ engine.addSystem((t) => {
|
|
|
21
16
|
let currentValue = 0
|
|
22
17
|
const options = [
|
|
23
18
|
function StretchAndTint() {
|
|
24
|
-
const tint2 = Color4.lerp(
|
|
25
|
-
Color4.Red(),
|
|
26
|
-
Color4.Blue(),
|
|
27
|
-
1 + Math.sin(dt + Math.cos(dt * 0.3)) * 0.5
|
|
28
|
-
)
|
|
19
|
+
const tint2 = Color4.lerp(Color4.Red(), Color4.Blue(), 1 + Math.sin(dt + Math.cos(dt * 0.3)) * 0.5)
|
|
29
20
|
return (
|
|
30
21
|
<UiEntity
|
|
31
22
|
uiTransform={{
|
|
@@ -45,11 +36,7 @@ const options = [
|
|
|
45
36
|
)
|
|
46
37
|
},
|
|
47
38
|
function NineSlicesAndTint() {
|
|
48
|
-
const tint = Color4.lerp(
|
|
49
|
-
Color4.Red(),
|
|
50
|
-
Color4.Blue(),
|
|
51
|
-
1 + Math.sin(dt + Math.cos(dt * 0.3)) * 0.5
|
|
52
|
-
)
|
|
39
|
+
const tint = Color4.lerp(Color4.Red(), Color4.Blue(), 1 + Math.sin(dt + Math.cos(dt * 0.3)) * 0.5)
|
|
53
40
|
return (
|
|
54
41
|
<UiEntity
|
|
55
42
|
uiTransform={{
|
|
@@ -64,11 +51,7 @@ const options = [
|
|
|
64
51
|
}
|
|
65
52
|
}}
|
|
66
53
|
>
|
|
67
|
-
<Label
|
|
68
|
-
value="NINE_SLICES + TINT"
|
|
69
|
-
color={Color4.Black()}
|
|
70
|
-
fontSize={29}
|
|
71
|
-
/>
|
|
54
|
+
<Label value="NINE_SLICES + TINT" color={Color4.Black()} fontSize={29} />
|
|
72
55
|
</UiEntity>
|
|
73
56
|
)
|
|
74
57
|
},
|
|
@@ -119,11 +102,7 @@ const options = [
|
|
|
119
102
|
}
|
|
120
103
|
}}
|
|
121
104
|
>
|
|
122
|
-
<Label
|
|
123
|
-
value={`NINE_SLICES (with margins ${margin.toFixed(2)})`}
|
|
124
|
-
color={Color4.Red()}
|
|
125
|
-
fontSize={29}
|
|
126
|
-
/>
|
|
105
|
+
<Label value={`NINE_SLICES (with margins ${margin.toFixed(2)})`} color={Color4.Red()} fontSize={29} />
|
|
127
106
|
</UiEntity>
|
|
128
107
|
)
|
|
129
108
|
},
|
|
@@ -32,11 +32,7 @@ export const uiComponent = () => (
|
|
|
32
32
|
display: 'flex'
|
|
33
33
|
}}
|
|
34
34
|
>
|
|
35
|
-
<Label
|
|
36
|
-
value="SDK 7"
|
|
37
|
-
fontSize={80}
|
|
38
|
-
uiBackground={{ color: Color4.fromHexString('#fbf0f0') }}
|
|
39
|
-
/>
|
|
35
|
+
<Label value="SDK 7" fontSize={80} uiBackground={{ color: Color4.fromHexString('#fbf0f0') }} />
|
|
40
36
|
</UiEntity>
|
|
41
37
|
<UiEntity
|
|
42
38
|
uiTransform={{
|
|
@@ -47,11 +43,7 @@ export const uiComponent = () => (
|
|
|
47
43
|
display: 'flex'
|
|
48
44
|
}}
|
|
49
45
|
>
|
|
50
|
-
<Label
|
|
51
|
-
value={`Counter: ${counter}`}
|
|
52
|
-
fontSize={60}
|
|
53
|
-
uiBackground={{ color: Color4.fromHexString('#fbf0f0') }}
|
|
54
|
-
/>
|
|
46
|
+
<Label value={`Counter: ${counter}`} fontSize={60} uiBackground={{ color: Color4.fromHexString('#fbf0f0') }} />
|
|
55
47
|
</UiEntity>
|
|
56
48
|
<UiEntity
|
|
57
49
|
uiTransform={{
|
|
@@ -106,10 +98,7 @@ function createCube(x: number, y: number, z: number, spawner = true): Entity {
|
|
|
106
98
|
|
|
107
99
|
// Systems
|
|
108
100
|
function circularSystem(dt: number) {
|
|
109
|
-
const entitiesWithMeshRenderer = engine.getEntitiesWith(
|
|
110
|
-
MeshRenderer,
|
|
111
|
-
Transform
|
|
112
|
-
)
|
|
101
|
+
const entitiesWithMeshRenderer = engine.getEntitiesWith(MeshRenderer, Transform)
|
|
113
102
|
for (const [entity, _meshRenderer, _transform] of entitiesWithMeshRenderer) {
|
|
114
103
|
const mutableTransform = Transform.getMutable(entity)
|
|
115
104
|
|
|
@@ -123,13 +112,7 @@ function circularSystem(dt: number) {
|
|
|
123
112
|
function spawnerSystem() {
|
|
124
113
|
const clickedCubes = engine.getEntitiesWith(PointerEvents)
|
|
125
114
|
for (const [entity] of clickedCubes) {
|
|
126
|
-
if (
|
|
127
|
-
inputSystem.isTriggered(
|
|
128
|
-
InputAction.IA_PRIMARY,
|
|
129
|
-
PointerEventType.PET_DOWN,
|
|
130
|
-
entity
|
|
131
|
-
)
|
|
132
|
-
) {
|
|
115
|
+
if (inputSystem.isTriggered(InputAction.IA_PRIMARY, PointerEventType.PET_DOWN, entity)) {
|
|
133
116
|
counter++
|
|
134
117
|
}
|
|
135
118
|
}
|