Page 2 of 2

Re: Liker error while trying to extend and recompile irrlich

Posted: Fri Mar 16, 2012 7:45 pm
by CuteAlien
It's the other way round - your event-receiver gets those events even before before the gui-elements receive them. With guiEnvironemnt->getRootGUIElement ()->getElementFromPoint(x,y) you can find out which element will receive a mouse-event.

Re: Liker error while trying to extend and recompile irrlich

Posted: Fri Mar 16, 2012 7:51 pm
by newbie8787
CuteAlien wrote:It's the other way round - your event-receiver gets those events even before before the gui-elements receive them. With guiEnvironemnt->getRootGUIElement ()->getElementFromPoint(x,y) you can find out which element will receive a mouse-event.
Even before I started on this whole endeavor , I checked the documentation on this method and it said :
"You should not need to use this method directly, unless you wish to reparent GUI elements to the top level. "

Re: Liker error while trying to extend and recompile irrlich

Posted: Fri Mar 16, 2012 9:01 pm
by CuteAlien
That is indeed a confusing comment... I'll put it on my todo to remove it. There is no reason not to use this function.

Re: Liker error while trying to extend and recompile irrlich

Posted: Fri Mar 16, 2012 9:29 pm
by RdR
Simple example:
http://pastie.org/3611002

Dont need to recompile Irrlicht to get that working, just make sure you add the Irrlicht sources to your Includes

Re: Liker error while trying to extend and recompile irrlich

Posted: Fri Mar 16, 2012 10:04 pm
by CuteAlien
Hm, I'm really not certain if that is a good idea RdR. Now you have 2 CGUIStaticText classes with the same name and in the same namespace in dll and in the project. I suspect with static linking it would probably even fail. I guess with dynamic linking it will probably work as they don't know about each other, but still not really sure if it's a good idea.

Re: Liker error while trying to extend and recompile irrlich

Posted: Fri Mar 16, 2012 10:07 pm
by RdR
CuteAlien wrote:Hm, I'm really not certain if that is a good idea RdR. Now you have 2 CGUIStaticText classes with the same name and in the same namespace in dll and in the project. I suspect with static linking it would probably even fail. I guess with dynamic linking it will probably work as they don't know about each other, but still not really sure if it's a good idea.
Dont know about static linking but linking dynamicly it works for sure.

Re: Liker error while trying to extend and recompile irrlich

Posted: Fri Mar 16, 2012 10:15 pm
by CuteAlien
My question is rather if it's correct. Often things work and are still wrong. I simply don't know if there are any guarantees for this case.

Re: Liker error while trying to extend and recompile irrlich

Posted: Fri Mar 16, 2012 11:17 pm
by RdR
CuteAlien wrote:My question is rather if it's correct. Often things work and are still wrong. I simply don't know if there are any guarantees for this case.
Hmm I used the same approach for my Count Down Button (http://irrlicht.sourceforge.net/forum/v ... =9&t=45795).
So far I hadnt any weird things or problems with it.

The correct why is to change it in Irrlicht, but that requires the topic starter to recompile Irrlicht.

Re: Liker error while trying to extend and recompile irrlich

Posted: Sat Mar 17, 2012 12:28 am
by serengeor
RdR wrote: The correct why is to change it in Irrlicht, but that requires the topic starter to recompile Irrlicht.
The best way (in my opinion) would be to actually copy and rename it, cause if you change it in the engine it will be harder to update the engine (without loosing changes).

Re: Liker error while trying to extend and recompile irrlich

Posted: Sat Mar 17, 2012 9:05 pm
by gerdb
hi, why do you derive from CGUIStaticText and have a member pointer to CGUIStaticText, means that you have 2 StaticTexts now, the one you are deriving from and the one you are creating with Environment->addStaticText()?

Also you have to implement all methods you are declaring.