Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi Niko. I am trying to unerstand the Overlay2DSceneNode. I have this code var pos3d = new CL3D.Vect3d(0,0,0); var BColor = CL3D.createColor(1, 150, 232, 249); var DimText = new CL3D.Overlay2DSceneNode(engine); engine.getScene().getRootSceneNode().addChild(DimText); var pos2d = engine.get2DPositionFrom3DPosition(pos3d); DimText.set2DPosition(pos2d.X, pos2d.Y, 256, 256); DimText.setText('1234') DimText.setShowBackgroundColor(true, BColor ); I can't see nothing on the screen and it brings an error error: c is not defined code copperlicht.js Line: 9 Now if i replace the setShowBackgroundColor with DimText.setShowImage(engine.getTextureManager().getTexture("sometexture.jpg", true)); i can see the texture only any suggestions? |
||||
|
Seems to be a bug, thanks for reporting. Going to fix this in the next release. |
||||
|
Update: This will be fixed in release 1.3.2. Also, if you still don't see anything, try instead of var BColor = CL3D.createColor(1, 150, 232, 249); this here with a bigger alpha value var BColor = CL3D.createColor(255, 150, 232, 249); |
||||
|
Now i can see the background color but i can't see the text !!!! again. And something else.As i wrote in a previous post in an exported mesh a collada file gives for a box 8 vertices and 12 indices and also 12 texture coordinates (same as indices).Which ones must i leave out from meshbuffer? (You are giving same number of texture coords (pairs) as number of vertices) Thanks. |
||||
|
You are right, sorry. It only works when setting the font manually before, try adding something like DimText.FontName = "12;default;arial;normal;bold;true"; then it should work. Going to improve this situation in a future release. |
||||
|
You forgot my second question. And something else.As i wrote in a previous post in an exported mesh a collada file gives for a box 8 vertices and 12 indices and also 12 texture coordinates (same as indices).Which ones must i leave out from meshbuffer? (You are giving same number of texture coords (pairs) as number of vertices) Thanks. |
||||
|
Not sure what you mean by 'leave out' regarding the collada file? |
||||
|
I ran into the same issues with this class. Thanks for clearing up its usage. What is the format of the FontName string supposed to be though? It doesn't look like CSS or anything. Are you just splitting the string? I agree it would be helpful to have a better defined way of setting these properties. On a related note, how can I change the text shadow color/attributes and turn it off in general? Thanks, --Nick |
||||
|
It's the internal format used by the CopperCube editor, that's why it is not yet documented. This situation will improve soon. |
|