Aframe 延伸超过实体高度的框架文本实体
嗨,我正在使用主分支作为框架,新的文本“component”似乎低于它所在实体的分配高度,其中包含一些不可见的内容。在此处输入代码并尝试移动到实体下方。这里的代码是从360图像库样板库中修改而来的Aframe 延伸超过实体高度的框架文本实体,aframe,Aframe,嗨,我正在使用主分支作为框架,新的文本“component”似乎低于它所在实体的分配高度,其中包含一些不可见的内容。在此处输入代码并尝试移动到实体下方。这里的代码是从360图像库样板库中修改而来的 <body> <a-scene> <a-assets> <img id="cubes" crossorigin="anonymous" src="https://cdn.aframe.io/360-image-gallery-boilerplate
<body>
<a-scene>
<a-assets>
<img id="cubes" crossorigin="anonymous" src="https://cdn.aframe.io/360-image-gallery-boilerplate/img/cubes.jpg">
</a-assets>
<a-sky id="image-360" radius="10" src="#cubes"></a-sky>
<a-entity layout="type: line; margin: 1.5" position="0 0 -3">
<a-entity
geometry="primitive: plane; height: 0.55; width: 1.9"
material="shader: flat; color: red"
text="value: Hello Worldllo Worldllo Worldllo Worldllo Worldllo Worldllo Worldllo Worldllo Worldllo Worldllo Worldllo World; color: black"></a-entity>
</a-entity>
<a-entity camera look-controls wasd-controls>
<a-cursor id="cursor"
animation__click="property: scale; startEvents: click; from: 0.1 0.1 0.1; to: 1 1 1; dur: 150"
event-set__1="_event: mouseenter; color: springgreen"
event-set__2="_event: mouseleave; color: black"></a-cursor>
</a-entity>
</a-scene>
不熟悉框架,所以不知道我做错了什么
缩放几何图形以适合文本
若要使几何体随文本自动缩放,请将几何体组件的“宽度”和“高度”属性设置为“自动”,然后根据需要设置文本组件的宽度。在此示例中,平面的宽度将设置为4个单位,其高度将设置为与文本的实际高度相匹配:
请注意,如果几何图形和文字都未指定宽度,则文字宽度特性将默认为1个单位(米),几何图形宽度特性也将变为1个单位
<a-entity
geometry="primitive: plane; height: auto; width: auto"
material="color: blue"
text="width: 4; value: This text will be 4 units wide."></a-entity>
<a-entity
geometry="primitive: plane"
material="color: blue"
text="value: 1-wide\ndefault."></a-entity>