【发布时间】:2022-01-06 10:59:36
【问题描述】:
我想在 A-Frame 中创建一个门户。我在官网上关注了this page。门户已显示,但我遇到了 2 个问题。提前谢谢你。
- 即使我在
<a-link title="Forest"...></a-link>中添加了title标记,标题也没有改变 - 我使用 VSCode + Live Server 进行开发。当我点击门户时,我希望它会导航到 forest.html,但什么也没发生。
我的代码如下:
<html>
<head>
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
<script src="https://unpkg.com/aframe-environment-component/dist/aframe-environment-component.min.js"></script>
<script src="https://unpkg.com/a-framedc@1.0.7/dist/aframedc.min.js"></script>
<script src="https://unpkg.com/aframe-event-set-component@^4.0.0/dist/aframe-event-set-component.min.js"></script>
</head>
<body>
<a-scene>
<!-- Assets -->
<a-assets>
<img id="forest" src="https://cdn.aframe.io/link-traversal/thumbs/forest.png">
</a-assets>
<a-link title="Forest" href="forest.html" position="0 1 1" image="#forest"></a-link>
<!--Forest Environment-->
<a-entity environment="preset: forest; dressingAmount: 100"></a-entity>
<!--A regular box-->
<a-box color="red" position="0 2 -5" rotation="0 45 45" scale="2 2 2"></a-box>
<!--Text-->
<a-entity
text="value: Hello, A-Frame!; color: #BBB"
position="-0.9 2 -3"
scale="5 5 5"></a-entity>
</a-scene>
</body>
</html>
【问题讨论】:
标签: aframe