Houge
Member
|
Gui always under mouse
Hello, I need some help with Gui objects, here is simple code example:
Code:
/******************************************************************************/
void InitPre() // init before engine inits
{
EE_INIT(); // call auto-generated function that will setup application name, load engine and project data
SimulateTouches(true);
}
/******************************************************************************/
bool Init() // initialize after engine is ready
{ return true; }
/******************************************************************************/
void Shut() // shut down at exit
{ }
/******************************************************************************/
bool Update() // main updating
{
if(Kb.bp(KB_ESC))return false; // exit if escape on the keyboard pressed
Gui.update();
if(MT.bp(0) && MT.guiObj(0) != null)
{
Gui.msgBox("", S + &Gui + " " +
MT.guiObj(0) + " " +
MT.guiObj(0)->desc() + " " +
MT.guiObj(0)->visible() + " " +
MT.guiObj(0)->enabled());
}
return true;
}
/******************************************************************************/
void Draw() // main drawing
{
D.clear(TURQ);
Gui.draw();
D.text (0, 0, "Hello to Esenthel Engine !");
}
/******************************************************************************/
As you can see there is no Gui at all, but if i press mouse button, message box always returns information, that i pressed Gui object that is visible and active. What am i doing wrong? I just want to test that there is no Gui under mouse when i press buttons.
P.S. you can remove SimulateTouches, the result will be the same.
(This post was last modified: 12-11-2016 01:40 PM by Houge.)
|
|
12-11-2016 01:38 PM |
|
Zervox
Member
|
RE: Gui always under mouse
This is because you still got Gui.desktop() if you add object!=Gui.desktop()(this is the actual Gui parent which your first window or so gets added to) it works.
(This post was last modified: 12-11-2016 02:06 PM by Zervox.)
|
|
12-11-2016 02:05 PM |
|