Like this, i want to draw text from bottom to top, or from top to bottom.
thanks!
[/img]
How to draw the text with vertical orientation?
-
- Posts: 7
- Joined: Sun Dec 13, 2009 1:54 am
-
- Competition winner
- Posts: 167
- Joined: Sun Jul 19, 2009 11:27 am
- Location: the Netherlands
- Contact:
I'm not sure you want to apply this in 2D or 3D but maybe you can render your text to a texture (RTT), then place this texture on a rotated quad.
Look at the render to texture example.
Also I found this wonderful topic. The forum search is great...
Recently I needed many text rotations and used OpenGl wglUseFontOutlines direct, some options available here.
Cheers
Escen
Look at the render to texture example.
Also I found this wonderful topic. The forum search is great...
Recently I needed many text rotations and used OpenGl wglUseFontOutlines direct, some options available here.
Cheers
Escen
-
- Posts: 7
- Joined: Sun Dec 13, 2009 1:54 am
-
- Competition winner
- Posts: 167
- Joined: Sun Jul 19, 2009 11:27 am
- Location: the Netherlands
- Contact:
Try some other bigger fonts
There is a really cool font tool at this topic
Code: Select all
gui::IGUIFont* font = guienv->getFont("myfont.xml");
if (font != 0)
{
guienv->getSkin()->setFont(font, gui::EGDF_DEFAULT);
}
-
- Competition winner
- Posts: 167
- Joined: Sun Jul 19, 2009 11:27 am
- Location: the Netherlands
- Contact:
OOPS... could not stop myself
Code: Select all
#include <irrlicht.h>
#include "CTextNode.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
int main()
{
IrrlichtDevice *device;
SIrrlichtCreationParameters deviceParameter;
deviceParameter.DriverType = EDT_OPENGL;
deviceParameter.AntiAlias = EAAM_QUALITY;
deviceParameter.Bits = 32;
deviceParameter.Fullscreen = false;
deviceParameter.Stencilbuffer=false;
deviceParameter.Vsync = false;
deviceParameter.WindowSize = dimension2d<s32>(400,800);
device = createDeviceEx(deviceParameter);
if (!device)
return 1;
device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
gui::IGUIFont* font = guienv->getFont("myfont.xml");
if (font != 0)
{
guienv->getSkin()->setFont(font, gui::EGDF_DEFAULT);
}
smgr->addCameraSceneNodeFPS();
CTextNode* text = new CTextNode(guienv, smgr->getRootSceneNode(), smgr);
text->setText("TEXT");
text->setPosition(irr::core::vector3df(0,20,0));
text->setRotation(irr::core::vector3df(0,0,90));
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
-
- Posts: 7
- Joined: Sun Dec 13, 2009 1:54 am