GUI question.....

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
hockey97
Posts: 41
Joined: Mon May 14, 2007 10:47 pm

GUI question.....

Post by hockey97 »

Hi how would you load a loading bar control and also the game's main menu I want to display a 3d model but like manymodels to make up a one whole looking.

like 25 3d models when the gamer saves their work ect progress ect the 3d model should show the progress like one big group of models that have 3d models on them like terrain with homes one them.

I want to do somehing like that in the game menu anc make the 3d models clickable like to load the game ect.
hockey97
Posts: 41
Joined: Mon May 14, 2007 10:47 pm

Post by hockey97 »

Hi I started making a script, a gui one type, I am trying to display an quit button.
here is my
code:
#include <iostream>
#include <stdlib.h>
#include <irrlicht.h>
#include <IGUIEnvironment.h>


using namespace std;
using namespace irr;
using namespace gui;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;

#pragma comment(lib, "Irrlicht.lib")
int main(int argc, char *argv[])
{

system("PAUSE");
return 0;
}
IrrlichtDevice *device = 0;
s32 cnt = 0;
IGUIListBox* listbox = 0;
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (event.EventType == EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
IGUIEnvironment* env = device->getGUIEnvironment();

switch(event.GUIEvent.EventType)
{
case EGET_BUTTON_CLICKED:
if (id == 101)
{
device->closeDevice();
return true;
}
env->addButton(rect<s32>(10,210,100,240), 0, 101, L"Quit");

Is that right so far???

The c++ compiler is giving me lot's of error's.

I really need help understanding the structure to make a gui menu with buttons ect.

I looked at the tut on the tut page of the site and also looked into the api but don't fully understand what need's to be called before the other's ect, basicly how to structure the script to make the element that I am trying to do meaning the rules ect.
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

There are so many things wrong with that code.... you don't know C++ very well?

Try copying all the code from an example, compiling, and recompiling every time you make a change. That way you'll know when you've done something wrong.

You need to make your questions a little clearer. Its hard to understand what you are asking at times... you use the word etcetera far too much...
hockey97
Posts: 41
Joined: Mon May 14, 2007 10:47 pm

Post by hockey97 »

I am using dev c++ for my scripts, and I copied and pasted example codeing and dosen't work, it gives me alot of erros so I made that script gavve me errors and mokeyed around with it , then got no errors but nothing happenes only a console pop's up asking to press any button and so Idid and then the console closes. I got the compiler setup properly,

In the project I right clicked and clicked project options where their has a tab button for dir ect one for libaries and one for include files and one for source file.

So I put the include dir adress for the include dir in irrlicht engine,

When I run some other exaple codes it say's can't find dir or file does not exist.

I even tried the example code from the tutorial for gui interfaces ect.
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

If you can't compile any one of the examples you don't have your project set up right. Follow this tutorial: http://irrlicht.sourceforge.net/tut_devcpp.html

Keep in mind that you have to set up EVERY project, its not a do it once and never again action.
hockey97
Posts: 41
Joined: Mon May 14, 2007 10:47 pm

Post by hockey97 »

Thanks finally got it to work followed it and couple times faild after the 5th time trying I got it to work, all my scripts work.

Thanks alot, :lol: :shock: feel kinda stupid :oops: :cry: :roll: :lol:
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

no reason to feel stupid.

just take it one step at a time and absorb all that you can.

read the forums they contain a few books worth of information as well as others websites and what not. coding is ALL about information and ideas. :idea:

oh btw. stop calling it script lol. 8)
GameDude
Posts: 500
Joined: Thu May 24, 2007 12:24 am

Post by GameDude »

Also plese edit your posts
hockey97
Posts: 41
Joined: Mon May 14, 2007 10:47 pm

Post by hockey97 »

Can someone explain to me how I would go about's on making a menu for my game but able to change the sking like the art of the gui with my own art ect??

I have been reading the api, and seen the gui classes ect butI don't know in coding how to setup up the gui, like how to call it, do I first call

the class for the gui element, how would I go abouts structure .
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

hockey97 wrote:Can someone explain to me how I would go about's on making a menu for my game but able to change the sking like the art of the gui with my own art ect??

I have been reading the api, and seen the gui classes ect butI don't know in coding how to setup up the gui, like how to call it, do I first call

the class for the gui element, how would I go abouts structure .
Okay.. I don't know why I have such a hard time understanding you -.- I think you're asking about skinning.

This tutorial http://irrlicht.sourceforge.net/tut005.html (tutorial 5) shows you how to grab your skin and change your font. The API has things like setColor for you to change the colors of everything documented http://irrlicht.sourceforge.net/docu/cl ... _skin.html

You can't really change the shape or appearance of anything other than its colors without using images.
hockey97
Posts: 41
Joined: Mon May 14, 2007 10:47 pm

Post by hockey97 »

I am asking How do I change the art of the game menu, in script????

Like I seen the api for the gui , I seen in their about skinning saying

it is used for changing the looks of the gui, I don't know if that means like

the size of the window or menu?? I don't fully know what that is used for??

What I am trying to do is to take images and display them in the

backround of the menu and also use my images I made for the buttons.

I want to use textures or just my images to be used in the game menu.
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
hockey97
Posts: 41
Joined: Mon May 14, 2007 10:47 pm

Post by hockey97 »

Thanks for the link, that's what I was looking for.

One more question does irrlicht support custom loading bards?? Or would I have to make my own code's??
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

Irrlicht doesn't have any kind of loading bar function... You have to do it all with your own code.
Post Reply