A-frame.js long a-text 值溢出问题
A-frame.js long a-text value overflow issue
我正在从事基于框架的项目。我一直在为 a-text 的长度而苦苦挣扎。 Here is the minimal demo. As you can see the text is overflowing the parent panel. I want to add some sort of scroll on in the overflowing text. I was able to make a scroll like behavior with the help of this 博客 post,但文本在父面板外仍然可见。
text
值不应消失在 parent 面板之外。 parent 在这里做的唯一一件事是设置相对变换(提供:位置、旋转和缩放)。它不会让看不见的东西超出它的范围。
博客 post 描述了将文本隐藏在屋顶和地板内(Hiding the Article
部分)。既然你有一个光球,扔掉任何覆盖元素(屋顶+天花板)都是一种耻辱。
可以使用渲染顺序
如果我们放入一个不可见的平面,并告诉它在 文本之前渲染,它看起来就像只显示了一个部分。
<a-entity text="long text"></a-entity>
<a-plane position="0 -0.3 0.1" width="4" rotation="0 -90 0"
material="transparent: true; opacity: 0; alphaTest: 0"></a-plane>
在 this fiddle 中查看。
Here你有一个带滚动条的fiddle,如果你稍微滚动一下,你会看到显示的文字。
我正在从事基于框架的项目。我一直在为 a-text 的长度而苦苦挣扎。 Here is the minimal demo. As you can see the text is overflowing the parent panel. I want to add some sort of scroll on in the overflowing text. I was able to make a scroll like behavior with the help of this 博客 post,但文本在父面板外仍然可见。
text
值不应消失在 parent 面板之外。 parent 在这里做的唯一一件事是设置相对变换(提供:位置、旋转和缩放)。它不会让看不见的东西超出它的范围。
博客 post 描述了将文本隐藏在屋顶和地板内(
Hiding the Article
部分)。既然你有一个光球,扔掉任何覆盖元素(屋顶+天花板)都是一种耻辱。
可以使用渲染顺序
如果我们放入一个不可见的平面,并告诉它在 文本之前渲染,它看起来就像只显示了一个部分。
<a-entity text="long text"></a-entity>
<a-plane position="0 -0.3 0.1" width="4" rotation="0 -90 0"
material="transparent: true; opacity: 0; alphaTest: 0"></a-plane>
在 this fiddle 中查看。
Here你有一个带滚动条的fiddle,如果你稍微滚动一下,你会看到显示的文字。