How to resize a context menu

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
The BasheR
Posts: 73
Joined: Thu Apr 05, 2007 7:01 pm
Location: France
Contact:

How to resize a context menu

Post by The BasheR »

Hi all, for my program i would like to have a context menu, but it is too small, and I don't know how to resize it :(

Is someone can tell me about this?

Thanks a lot.
When you want you can!
Quand on veut on peut!
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Context menus set their own size, which is based on the size of the skin's font. use env->getSkin()->setFont to set a different sized font.
Thinking about this, perhaps we should have the option for several fonts rather than just one for the entire skin.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
The BasheR
Posts: 73
Joined: Thu Apr 05, 2007 7:01 pm
Location: France
Contact:

Post by The BasheR »

Thank you, can you say me the entire code to do that please? Because i don't font the function in the doc :(
When you want you can!
Quand on veut on peut!
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

I believe the 2d graphics tutorial loads a custom font. Have a look there.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

env->getSkin()->setFont( env->getFont("Font From Font Tool"));

is that enough docs for you? ;)
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
The BasheR
Posts: 73
Joined: Thu Apr 05, 2007 7:01 pm
Location: France
Contact:

Post by The BasheR »

Oh ok, thank you, actually i thought we could directly change the size of the font.

So thank you.


EDIT => i have also an other problem => when i resize the window to maximise it the context menu's width is not the same that the one of the widow, so is there a way to solve this problem?
When you want you can!
Quand on veut on peut!
The BasheR
Posts: 73
Joined: Thu Apr 05, 2007 7:01 pm
Location: France
Contact:

Post by The BasheR »

Nobody knows?
When you want you can!
Quand on veut on peut!
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

You need to get the resolution of the window after resizing it and then alter the size of your box. I'm not sure of the exact code. I don't think Irrlicht actually has a getResolution function...
The BasheR
Posts: 73
Joined: Thu Apr 05, 2007 7:01 pm
Location: France
Contact:

Post by The BasheR »

Ok thank you
When you want you can!
Quand on veut on peut!
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

this is/was a bug, it is now fixed in svn as of revision 652.
If you want to fix it yourself, change RelativeRect to DesiredRect in the following files/functions-
CGUIEnvironment.cpp : CGUIEnvironment::drawAll()
CGUIMenu.cpp : CGUIMenu::updateAbsolutePosition()

and recompile Irrlicht.. thanks for reporting this :)
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
The BasheR
Posts: 73
Joined: Thu Apr 05, 2007 7:01 pm
Location: France
Contact:

Post by The BasheR »

Ok thank you.
I'm goint to report it.
When you want you can!
Quand on veut on peut!
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

It doesn't need to be reported; it was fixed in the SVN he mentioned.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Too late :lol:
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

lol this is why I just don't bother anymore... :roll:
Post Reply