-
i try to render given the following options return (
<div className="pt-16 h-full w-full min-h-screen">
<Canvas >
<Text color="black" anchorX="center" anchorY="middle" font={"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff"} >
hello world!
</Text>
</Canvas>
</div>
) cors is configured correctly, i dont get any errors nor other indication except it works with function Thing() {
const ref = useRef()
useFrame(() => (ref.current.rotation.x = ref.current.rotation.y += 0.01))
return (
<mesh
ref={ref}
onClick={e => console.log('click')}
onPointerOver={e => console.log('hover')}
onPointerOut={e => console.log('unhover')}>
<boxBufferGeometry attach="geometry" args={[1, 1, 1]} />
<meshNormalMaterial attach="material" />
</mesh>
)
}
...
<Canvas>
<Thing />
</Canvas>
... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
there are dozens of running examples with text, here's one https://codesandbox.io/s/html-input-fields-024uom the sandbox you posted uses ancient packages (react-three-fiber is deprecated, use @react-three/fiber) troika default fontsize is tiny btw, it might just be that you don't see the text. edit: fontSize={1} works, i see the text. but i think a default that small makes little sense, i'll set it to 1. |
Beta Was this translation helpful? Give feedback.
there are dozens of running examples with text, here's one https://codesandbox.io/s/html-input-fields-024uom
the sandbox you posted uses ancient packages (react-three-fiber is deprecated, use @react-three/fiber)
troika default fontsize is tiny btw, it might just be that you don't see the text.
edit:
fontSize={1} works, i see the text. but i think a default that small makes little sense, i'll set it to 1.