varied questions

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
haraelendil
Posts: 6
Joined: Sun Jan 30, 2005 4:56 pm

varied questions

Post by haraelendil »

Hi, here is some questions i had after readin the tutorial about makin a user interface :

1) How can i set the font size?

2) How can i make a display of a int variable?

3) When i try to load a fond texture, i have that: "The amount of upper pixels or lower corner pixels is == 0,font file may be corrupted", and i see a blue fons, what can i do?

Thank you :)
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Re: varied questions

Post by Spintz »

haraelendil wrote:1) How can i set the font size?
This depends on the size of the fonts in your bitmap. The IrrFontTool allows you to pick the font size before creating the bitmap with the font on it.
haraelendil wrote:2) How can i make a display of a int variable?

Code: Select all

core::stringw wStr = "This is my integer - ";
wStr += (int)var;
Then use the wStr as input into a GUI element.
haraelendil wrote:3) When i try to load a fond texture, i have that: "The amount of upper pixels or lower corner pixels is == 0,font file may be corrupted", and i see a blue fons, what can i do?
What font texture are you trying to load?
Image
haraelendil
Posts: 6
Joined: Sun Jan 30, 2005 4:56 pm

Post by haraelendil »

Ok, let's do that again^^

1) => ok

2) =>
Spintz wrote:Then use the wStr as input into a GUI element.
How can i do that?

3) just a jpg file
Guest

Post by Guest »

2.) i guess he means something like this:

core::stringw wStr = "This is my integer - ";
wStr += (int)var;

guienv->addStaticText(wStr, rect<int>(10,10,200,22), true);

3.) in the irrlicht directory there is a folder called Tools, which contains a Font converter. you can convert standart font files with that tool to font bitmaps which you then can use in irrlicht.
haraelendil
Posts: 6
Joined: Sun Jan 30, 2005 4:56 pm

Post by haraelendil »

2)
it's what i tried, but doesn't work:

no matching function for call to `irr::gui::IGUIEnvironment::addStaticText(irr::core::stringw&, irr::core::rect<irr::s32>, bool)'
candidates are: virtual irr::gui::IGUIStaticText* irr::gui::IGUIEnvironment::addStaticText(const wchar_t*, const irr::core::rect<irr::s32>&, bool, bool, irr::gui::IGUIElement*, irr::s32)

3) ok, thanks ;)
adamc

Post by adamc »

in reference to number two, how about using stdlib::atoi() then concatenating?
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post by pfo »

I think the problem with #2 is the way you're calling addStaticText; it didn't find a matching function for it, but it found a candidate. Could you paste the code here where you add the static text to the GUI? I think that's where the problem lies.
Post Reply