Problem: Adding static text

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
delfy
Posts: 5
Joined: Sun Aug 24, 2003 7:42 pm

Problem: Adding static text

Post by delfy »

I have a code

Code: Select all

// HelloUniverse.cpp
// Include the Irrlicht header
#include <irrlicht.h>

// Irrlicht Namespaces
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;


int main()
{
    IrrlichtDevice *irrDevice = createDevice(DT_DIRECTX8,
                                          dimension2d<s32>(512, 384),
                                          16,
                                          false,
                                          false,
                                          0);
                                          
    irrDevice->setWindowCaption(L"Vojkotov testni primer z Irrlicht pogonom!");
    
    IVideoDriver* irrDriver = irrDevice->getVideoDriver();
    ISceneManager* irrSceneMgr = irrDevice->getSceneManager();
    IGUIEnvironment* irrGUIEnv = irrDevice->getGUIEnvironment();

    [b]irrGUIEnv->addStaticText(
            L"Krneki",
            false,
            rect<int>(10,10,500,50));[/b]
    
    irrGUIEnv->addStaticText(
            L"Pozdravljen svet! To je Vojkotovo besedilo!",
    	    false,
	        rect<int>(10,70,500,50));
    
    while(irrDevice->run())
    { 
        irrDriver->beginScene(true, true, SColor(0,255,255,255));
                
                
                irrSceneMgr->drawAll(); //izrise scene managerja
                irrGUIEnv->drawAll(); //izrise GUI
                
	    irrDriver->endScene();
	}
 
    irrDevice->drop();

    return(0);
}
I always see only second text - non-bold. Even if i move bold behind second text, i always see only unbold text. Why??? I programming in Dev C++
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Simple answer, take a closer look at the coordinates you entered:

Code: Select all

 rect<int>(10,70,500,50)
Possible solution: Swap 70 with 50 and it will work.[/list]
delfy
Posts: 5
Joined: Sun Aug 24, 2003 7:42 pm

Post by delfy »

Code: Select all

irrGUIEnv->addStaticText( 
            L"Krneki", 
            false, 
            rect<int>(10,10,500,50));
This static text i can't see!! Why
FleshCrawler
Posts: 108
Joined: Fri Aug 22, 2003 1:04 pm
Location: Kerkrade, Netherlands
Contact:

Post by FleshCrawler »

it renders the text out of the screen(at least it looks like that), set 10,70,500,50 to 10,10,500,80 and it draws beneath it :)

if that is what u want, because i rendered them on the same place 10,10,500,50 and there it worked fine, then i changed the 50 to 80 and it still worked. hope this helps a bit :)
Post Reply