2017-02-01 8 views
0

こんにちは、私はフレームのマスターブランチを使用しています。新しいテキスト「コンポーネント」は、それがいくつかの目に見えないものと一緒に存在するエンティティの割り当てられた高さを下回っているようです。 Codepenここにhttp://codepen.io/anon/pen/PWQXRPとエンティティの下に移動しようとします。 360-画像ギャラリー定型レポから変更されたここでは、コードエンティティの高さを越えているAframeテキストエンティティ

<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> 

新しいので、私は間違って

答えて

0

https://aframe.io/docs/master/components/text.html#scaling-geometry-to-fit-text

スケーリングをやって何見当もつかないAFRAMEしますジオメトリをテキストに合わせる

ジオメトリを自動的にテキストに合わせるには、s geometryコンポーネントのwidthおよびheightプロパティをautoに設定し、テキストコンポーネントの幅を必要に応じて設定します。この例では、平面の幅が4つの単位に設定され、その高さは、テキストの実際の高さと一致するように設定されます

<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> 

注いずれジオメトリやテキスト場合は、幅を指定することテキスト幅プロパティはデフォルトで1単位(メートル)になり、ジオメトリ幅プロパティは1単位になります。

<a-entity 
    geometry="primitive: plane" 
    material="color: blue" 
    text="value: 1-wide\ndefault."></a-entity> 
関連する問題