Total Noob needing GUI assistance

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
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Total Noob needing GUI assistance

Post by Tyn »

Lo

I'm a total noob at game programming, I do know C++ fairly well and having a bro who knows the structure of programs ( in Java ) solves most problems I have.

I have two problems with GUI.

My first is the GUI interface itself. Basically I want to completely redesign my own GUI interface with custom images/sizes/shapes etc. Is there an easy way in this engine to do that or do I basically do it the same way as if I was writing my own engine? I sort of ( from tutorials ) know how to do it in OpenGL and assume it is pretty much the same in DX but looking at the way it's created in the examples seems a lot simpler. Is there a command you can make to make a button use a certain image, adjust the placement of text etc.

My other problem is creating a HUD for the 3D scene. I read the tutorial but still am a little perplexed about how to place the HUD where I want it. Are there seperate coords for screen position opposed to world(scene) position? I don't have a great grasp on Billboards but I understand a little and think this is what I use but not totally sure on that one.

Thanks for helping a total noob :)
Isometric God
Posts: 69
Joined: Sun Oct 12, 2003 3:42 pm
Location: Germany

Post by Isometric God »

I think you have to derive your own button class from the Irrlicht version and write your own rendering function. Have a look at the Irrlicht source code to see how it's done.

There are two different types of coordinates. World coordinates are used when it comes to rendering your virtual world. Screen coordinates are s32 usually and describe the space between the top left corner of your window and the bottom right corner. The HUD uses screen coordinates, everything else ( as fas as I know ) uses world coords.
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Oh yeah, I see that from the example source code, thanx a lot for that :)
Masdus
Posts: 186
Joined: Tue Aug 26, 2003 1:13 pm
Location: Australia

Post by Masdus »

with regards to changing buttons it is possible to derive your own buttons from the gui button and then change the draw function to draw an image. I have done this previously but i can't post the code as i'm not currently near my home computer (i'm working in another city for 10 weeks or so). Also Niko has listed skinable gui elements as a todo, so they will exist in a future release. Might be best just to use the default buttons until then. I am working on a tutorial for modifying gui elements which should explain the process if you do want to derive your own elements
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

I could make the button completely invisible, in that way I can hack a quick underlayer of my image and use it that way couldn't I?
Masdus
Posts: 186
Joined: Tue Aug 26, 2003 1:13 pm
Location: Australia

Post by Masdus »

making the button invisble also disables its functions, it you can see it you can't click on it. You can change this by editing one line of code in the engine but i can't remeber which line it is.
Guest

Post by Guest »

Derive your own button ( or whatever you want ) from the Irrlicht GUI and add an empy drawing function. This makes your button invisible, but allows to respond to events...
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Cheers, I think I'll wait so I don't have to recompile the engine or anything like that for every update :) An option to change the rect command to 2DImage for all the GUI would be nice but I don't expect everything tailored to me ( as nice as it would be :D )

I'll wait until the skinnable buttons are finished and try to do work out how it is done and how I can do that for whatever else I need. Cheers for the help guys.
Masdus
Posts: 186
Joined: Tue Aug 26, 2003 1:13 pm
Location: Australia

Post by Masdus »

when i've got time i'll release the code i made for simple image buttons, i'm pretty sure i managed to do it with out recompiling the engine
Post Reply