只有在由检查员创建时才显示的实体文本 [英] a-entity text only showing when created by the Inspector

查看:127
本文介绍了只有在由检查员创建时才显示的实体文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图做一些超级简单的事情,例如显示一些文本。它工作了几个小时,但现在不是。这是确切的代码:

 <!DOCTYPE html> 
< html>
< head>
< meta charset =utf-8/>
< meta name =viewportcontent =width = device-width,initial-scale = 1.0/>
< script src =https://aframe.io/releases/0.5.0/aframe.min.jsasync>< / script>
< meta name =descriptioncontent =科学实验室为虚拟现实中的家庭学生>

< / head>
< body>

< a-scene>
< a-assets>
< img id =groundTexturesrc =https://cdn.aframe.io/a-painter/images/floor.jpg>
< img id =skyTexturesrc =https://cdn.aframe.io/a-painter/images/sky.jpg>
< / a-assets>
< a-cylinder id =groundsrc =#groundTextureradius =30height =0.1>< / a-cylinder>
< a-sky id =backgroundsrc =#skyTexturetheta-length =90radius =30>< / a-sky>



正如你所看到的,没有文字的标志(当它由于缩放设置而应该看起来很大时)。
任何想法?

编辑:
这里是0.5 0.5 0.5

注意:我在将图片上传到StackOverflow时遇到问题: http://i66.tinypic.com/a47l2b.jpg



以下是10 10 10:
http://i67.tinypic.com/npfd50.jpg



另外,我不能用图形(红色,黑色,黄色箭头)移动a实体,但是如果我在属性面板中更改它们,我可以。

编辑2
以下是Glitch中的代码共享:
https://glitch.com/edit/#!/nebulous-pail?path=index .html:1:0

解决方案

好吧。到目前为止,问题似乎是异步加载A-Frame:

 < script src =https:// aframe.io/releases/0.5.0/aframe.min.jsasync>< / script> 

我们需要省略async属性才能使用它:

 < script src =https://aframe.io/releases/0.5.0/aframe.min.js>< / script> 

我的理论是,在元素加载完成后,它不会优雅地升级元素。



我甚至尝试将文本添加为​​mixin,但它不起作用,除非A-Frame被首先加载。


I've been trying to do something super simple, such as displaying some text. It was working a couple of hours back, but now it its not. This is the exact code:

    <!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <script src="https://aframe.io/releases/0.5.0/aframe.min.js" async></script>
    <meta name="description" content="Science Labs for Homeschoolers in Virtual Reality">

</head>
<body>

<a-scene>
  <a-assets>
    <img id="groundTexture" src="https://cdn.aframe.io/a-painter/images/floor.jpg">
    <img id="skyTexture" src="https://cdn.aframe.io/a-painter/images/sky.jpg">
  </a-assets>
  <a-cylinder id="ground" src="#groundTexture" radius="30" height="0.1"></a-cylinder>
  <a-sky id="background" src="#skyTexture" theta-length="90" radius="30"></a-sky>
<a-entity position="0.768 1.04 -3.442" rotation="0 0 0" scale="10 10 2" visible="true" text="value:Hello Berry Berry;"></a-entity>    
</a-scene>
<script type="text/javascript" src="build/client/bundle.js"></script></body>

</html>

It's just a testing project. Currently using nodejs v7.10.0 with express 4.15.3 with webpack. Using Google Chrome 58.0.3 and Edge 15.

Nothing fancy, just serving the index.html file (what you're seeing above).

No matter what, I can't see the text (Only from this file). I've also tried:

  1. Looking around the scene.
  2. Setting the text double sided to spot it.
  3. Copying the exact asset from the inspector to my code.
  4. Changing the position
  5. Changing the text scale.

This is what's resulting:

As you can see, there's no sign of the text (when it should look big due to the scale settings). Any ideas? Thank you very much!

Edit: Here is with 0.5 0.5 0.5

Side note: I'm having problems uploading images to StackOverflow: http://i66.tinypic.com/a47l2b.jpg

Here's with 10 10 10: http://i67.tinypic.com/npfd50.jpg

In addition, I can't move the a-entity "graphically" (With the red, black, yellow arrows), but I can if I change them in the properties panel.

Edit 2: Here is a code share in Glitch: https://glitch.com/edit/#!/nebulous-pail?path=index.html:1:0

解决方案

Well. It seems that the problem, so far, was loading A-Frame asynchronously:

<script src="https://aframe.io/releases/0.5.0/aframe.min.js" async></script>

We need to omit the "async" attribute for it to work:

 <script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>

My theory would be that it is not gracefully upgrading the element after it has been loaded.

I even tried adding the text as a mixin, but it will not work unless A-Frame has been loaded first.

这篇关于只有在由检查员创建时才显示的实体文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆