Page 1 of 1

how to scale some text

Posted: Thu Aug 20, 2009 2:06 am
by dujimache
smgr:addTextSceneNode(font,"i have a dream,one day i have a car!",render.video.SColor(255,0,255,255),0,render.core.vector3d(0,30,-500))
i add some text in the scene,and i want to scale them,how???

Posted: Thu Aug 20, 2009 2:15 am
by lulzfish
If it's a scene node, you should be able to do something like this:

Code: Select all

ITextSceneNode * text = smgr->addTextSceneNode (font, "blah", SColor (255, 0, 255, 255), 0, vector3df (0, 30, -500));
text->setScale (vector3df (10, 10, 10));
So, the ITextSceneNode should have a member function named setScale. You seem to be using a different language than C/C++, though, so I'm not sure how it will translate.

edit: Yeah, I don't know Lua, sorry. :/

Posted: Thu Aug 20, 2009 2:27 am
by dujimache
i use irrlua ,and i tried your method,but it did't work,thank you

Re: how to scale some text

Posted: Fri Mar 03, 2017 5:46 am
by Arclamp
This node doesn't scale! It uses something like a static text to overlay text, so the size is dependent on the actual font size, it also draws on top of all other geometry too (like a gui element does)

Re: how to scale some text

Posted: Fri Mar 03, 2017 10:39 am
by Mel
You need a larger font to render larger texts, that, until Irrlicht implements signed distance field font rendering, which is shader dependant, but also able to scale bitmap fonts with vector-like quality. I guess the SDF rendering is overkill, but allows free scaling of fonts

https://www.youtube.com/watch?v=CGZRHJvJYIg

Re: how to scale some text

Posted: Fri Mar 03, 2017 1:47 pm
by CuteAlien
IBillboardTextSceneNode can do some zoom (but it's not resizing the font, but zooming the bitmap). ITextSceneNode can't.

One other solution: Create fonts with different sizes and switch between them.

Or check font-wrappers for ttf like the CGUIFont classes here: https://bitbucket.org/mzeilfelder/irr-p ... -micha/src (wrapper is based on some other ttf code wrapper in forum: http://irrlicht.sourceforge.net/forum/v ... =6&t=37296). Thought not sure how to use that with irrlua as I'm not familiar with that.