-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path12-ProxyEvent.html
55 lines (55 loc) · 2.22 KB
/
12-ProxyEvent.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Proxy Event</title>
<!-- Agar animasi yang awalnya disematkan di pengontrol, bisa dipindah ke yang dikontrol -->
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/[email protected]/dist/aframe-extras.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-event-set-component.min.js"></script>
<script src="https://unpkg.com/aframe-proxy-event-component/dist/aframe-proxy-event-component.min.js"></script>
<!-- Agar komponen yang kita punya menghadap ke komponen yang lain secara kontinyu -->
<script src="https://unpkg.com/[email protected]/dist/aframe-look-at-component.min.js"></script>
</head>
<body>
<a-scene>
<a-camera id="cam">
<a-cursor></a-cursor>
</a-camera>
<a-entity
geometry="primitive:triangle"
text__btn_up="align:center;baseline:top;value:UP;wrapCount:5;"
position="-2 2.5 -3"
material="color:green"
look-at="#cam"
proxy-event__satu="
event:click;
as:atas;
to:#box;
"
></a-entity>
<a-entity
text__btn_down="align:center;baseline:bottom;value:DOWN;wrapCount:10;"
position="-2 1 -3"
>
<!-- Agar yang berputar hanya segitiganya, teks tidak perlu -->
<a-entity
geometry="primitive:triangle"
material="color:green"
rotation="0 0 180"
proxy-event__satu="
event:click;
as:bawah;
to:#box;
"
></a-entity>
</a-entity>
<a-box id="box" color="#aaaa00" position="1 1.5 -3"
animation__atas="property:position;to:1 2.5 -3;startEvents:atas"
animation__bawah="property:position;to:1 0.5 -3;startEvents:bawah"
animation__reset="property:position;to:1 1.5 -3;startEvents:click"
></a-box>
</a-scene>
</body>
</html>