Hi, it seems that the example in https://cospaces.io/api/#textbillboardsetsize doesn’t work.
I eman: the link to the example itself launch the example in action, but a part the first cretaeTextBillboard command, all the others doesn’t take effect. If i copy the code in my scene, i get the same results…
did you change the syntax and forgot to change the docs, or do i miss some step?
thanks for pointing that out! There has been a change in the API regarding texts, which has not been reflected in the documentation yet.
Now, the item created by Scene.createTextBillboard() is a Cuboid-Item with a Text-Item attached as a child. There’s also a new method called Scene.createText() to only make the Text-Item itself. Below are some examples:
1. How to make the new text item
let text = Scene.createText(0, 0, 1, "Hello World!");
text.setFontSize(10);
text.setColor(255, 0, 0);
2. How to make a text billboard item
The item created with Scene.createTextBillboard is simply a Cuboid-Item with a Text-Item as a child. You can call methods on the Cuboid and it will set properties on the Text-Item it has as a child.
Hi Sarah, the Scene.createText method no longer exists - you’ll need to create/get a TextItem object and use the text property to update the text. See TextItem | for details.