ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperLicht
forum topic indicator Rendering Text
person icon
nanni
Registered User
Quote
2011-05-14 08:18:40

What's the best way to render some text into a scene?
Does Exists an equivalent method of: GLGE.Text()?

Thanks.

person icon
niko
Moderator
Quote
2011-05-14 11:15:01

Simply create a CL3D.Overlay2DSceneNode, see the documentation for that. It has a setText() function. Use it like this:
var t = new CL3D.Overlay2DSceneNode(engine);
engine.getScene().getRootSceneNode().addChild(t);
t.set2DPosition(10, 10, 256, 256);
t.setText('Hello World')
var color = = CL3D.createColor(255, 150, 232, 249);
t.setShowBackgroundColor(true, color );
t.FontName = "12;default;arial;normal;bold;true";


This will be much simplified in a future update.

person icon
nanni
Registered User
Quote
2011-05-15 22:39:26

I would put the text into the 3D space, like any other mesh.
Is it possible?

person icon
niko
Moderator
Quote
2011-05-16 08:33:11

Well, you could use either the texture created by the 2D overlay node above, and place it over any 3d object you want, or use the Renderer.createTextureFrom2DCanvas() function. You can draw text and stuff into a 2D HTML canvas and create a texture from that using this method.


Create reply:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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