how to apply Pixi.Text texture to the face of a cube? #146
Answered
by
jnsmalm
ChristieLukose
asked this question in
Q&A
-
Hello, Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Answered by
jnsmalm
Dec 21, 2022
Replies: 1 comment 1 reply
-
Hi! The easiest way to achieve this is to have a cube mesh and a separate face with the text texture (you can use Sprite3D for this). let box = app.stage.addChild(Mesh3D.createCube())
let sprite = box.addChild(new Sprite3D())
sprite.z = 1.01 // The size of the box plus a small amount to avoid z-fighting.
let text = new Text("This is regular\nPixiJS text")
text.updateText(false)
sprite.texture = text.texture |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ChristieLukose
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
The easiest way to achieve this is to have a cube mesh and a separate face with the text texture (you can use Sprite3D for this).