Some 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
Magus_Stragus
Posts: 86
Joined: Wed Aug 29, 2007 10:45 pm

Some questions...

Post by Magus_Stragus »

Hey there. Me again with some questions. Hope you can help me.

1- In this program I'm making, I need that when the user press the Key Enter (Return), certain button on screen get pressed. The thing is, the button is not always the same (the button is on a window, there are several types of windows, but only one of them active at a time, hence, only one button on screen). How can I make that when the user press Enter the button get "pressed" as well (as if the user would have pressed it by himself)? I can take the long road and ask the program which window was active, and do what the button is supposed to do manually, but is there a faster way to just say the button "press yourself when the user press Enter"?
2- Does anyone know of a library that helps me create codified save files for games that works with Irrlicht?
3- Is there a way to maximize the main window (the device) as soon as it's created?
4- Is there a function to know which window of a GUI environment is currently active?
5- Does anyone know of a way to create curve lines in Irrlicht (splines, circle arcs, sine curves, etc)? Or do I have to create myself the mathematical function and find the points and draw several lines to do that?
6- Is there a way to move the geometrical centre of the main window (point x,y = 0,0) from the top left corner to the centre of the window (this is, the point 0,0 located in the centre of the window, not the top left corner)?

Thanks in advance for your time.
Proud member of the Online Campaign for Real English. If you believe in capital letters, correct spelling and good sentence structure then copy this into your signature.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Re: Some questions...

Post by bitplane »

Magus_Stragus wrote:Hey there. Me again with some questions. Hope you can help me.

1- In this program I'm making, I need that when the user press the Key Enter (Return), certain button on screen get pressed. The thing is, the button is not always the same (the button is on a window, there are several types of windows, but only one of them active at a time, hence, only one button on screen). How can I make that when the user press Enter the button get "pressed" as well (as if the user would have pressed it by himself)? I can take the long road and ask the program which window was active, and do what the button is supposed to do manually, but is there a faster way to just say the button "press yourself when the user press Enter"?
env->setFocus(MyButton), then space or return will press the button for you.
2- Does anyone know of a library that helps me create codified save files for games that works with Irrlicht?
see createXMLReader, createXMLWriter*, loadScene and saveScene functions.
3- Is there a way to maximize the main window (the device) as soon as it's created?
Read the code to the demo in the examples dir.
4- Is there a function to know which window of a GUI environment is currently active?
getFocus() then call getParent() and getType() on the elements until you find a window.
5- Does anyone know of a way to create curve lines in Irrlicht (splines, circle arcs, sine curves, etc)? Or do I have to create myself the mathematical function and find the points and draw several lines to do that?
Yep, you'll need to make it yourself and use draw3dLine or one of the other 3d drawing calls (see IVideoDriver docs)
6- Is there a way to move the geometrical centre of the main window (point x,y = 0,0) from the top left corner to the centre of the window (this is, the point 0,0 located in the centre of the window, not the top left corner)?
Not without modifying the engine. It would be easier to just subtract half the viewport width and height from the mouse coordinates.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Magus_Stragus
Posts: 86
Joined: Wed Aug 29, 2007 10:45 pm

Post by Magus_Stragus »

Thanks for the help!
Proud member of the Online Campaign for Real English. If you believe in capital letters, correct spelling and good sentence structure then copy this into your signature.
Magus_Stragus
Posts: 86
Joined: Wed Aug 29, 2007 10:45 pm

Post by Magus_Stragus »

I'm sorry, but I didn't find anything pointing to maximize the window upon execution on the demo. I found to put it on fullscreen ode, but that's not what I want. I want to maximize it. How can I do that?
Proud member of the Online Campaign for Real English. If you believe in capital letters, correct spelling and good sentence structure then copy this into your signature.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Good question really, i wanted to do this at one point but i decided to just go with fullscreen, though if you want the window bar at the top you can't do that obviously.

You can find the current desktop resolution easily with the null driver and then create a device of that size but that will actually make the window slightly bigger than maximised. I then tried to make the window 95% less than the current desktop size but that killed the render quality for some reason...
Image Image Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

There's currently no way to toggle the maximized state of windows, but it should be easily possible to add such methods. After all we can already query the maximized state, can't we? Oh no, that was minimized, but also that state cannot be toggled programatically.
Magus_Stragus
Posts: 86
Joined: Wed Aug 29, 2007 10:45 pm

Post by Magus_Stragus »

So, it's impossible to do that...
I have that problem as well, when I use a device size larger than 800x600 the device usually has graphical problems (such as things being drawn more slowly). Why's this?
Proud member of the Online Campaign for Real English. If you believe in capital letters, correct spelling and good sentence structure then copy this into your signature.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Oh, hmm, didn't see such things, yet. Maybe it's the gfx card.
Post Reply