Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Overlay2DSceneNode Problems

bagg
Registered User
Quote
2010-11-28 09:47:37

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?


niko
Moderator
Quote
2010-11-28 18:06:36

Seems to be a bug, thanks for reporting. Going to fix this in the next release.


niko
Moderator
Quote
2010-12-02 09:13:23

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



bagg
Registered User
Quote
2010-12-02 12:56:50

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.


niko
Moderator
Quote
2010-12-03 07:59:20

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.


bagg
Registered User
Quote
2010-12-03 10:16:10

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.


niko
Moderator
Quote
2010-12-05 16:30:36

Not sure what you mean by 'leave out' regarding the collada file?


nciagra
Registered User
Quote
2010-12-06 20:02:10

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


niko
Moderator
Quote
2010-12-07 16:56:54

It's the internal format used by the CopperCube editor, that's why it is not yet documented. This situation will improve soon.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "?nternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact