About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
[Fixed] Window FadeIn nice bug
Author Message
Houge Offline
Silver Supporter

Post: #1
[Fixed] Window FadeIn nice bug
Hi, i found a nice bug with window.FadeIn();
Demo project can be loaded here.

So first goes the task: when i press on my game object (character in demo project), a window appears by fading in.
The problem: sometimes it fades in, but sometimes it appears constantly without fade effect!

And i found a reason experimentally smile
When you press on a character and mouse pos is inside window rect, then it appears without fading animation, but when mouse pos is outside window rect, it appears with animation, as expected.

There are two lines with window rect in demo project, #56 and #57, if you try both of them you will see the issue.
(This post was last modified: 05-25-2017 07:15 AM by Houge.)
05-24-2017 09:40 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Window FadeIn nice bug
Hi,

If you perform some action based on a touch press, and don't want this touch press trigger something else, you can call Touch.eat

Code:
if(Touches[0].pd())
{
   win.fadeToggle();
   Touches[0].eat();
}
05-25-2017 03:09 AM
Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #3
RE: Window FadeIn nice bug
Touch.eat does not help, window is shown without fade animation.

It works well with Gui app only:
Code:
/******************************************************************************/
ModalWindow win;
/******************************************************************************/
void InitPre()
{
   EE_INIT();
   SimulateTouches(true);
}
/******************************************************************************/
bool Init()
{
   Gui+=win.create(Rect_C(0, 0, 1, 1));
   return true;
}
/******************************************************************************/
void Shut()
{ }
/******************************************************************************/
bool Update()
{
   if(Kb.bp(KB_ESC))return false;
  
   Gui.update();
  
   if(Touches.elms() && Touches[0].pd() && Touches[0].guiObj() == Gui.desktop())
   {
       win.fadeIn();
   }
  
   return true;
}
/******************************************************************************/
void Draw()
{
   D.clear(TURQ);
   Gui.draw();
}
/******************************************************************************/

But if there's a 3d object, it fails. I don't know why is that.
(This post was last modified: 05-25-2017 06:19 AM by Houge.)
05-25-2017 06:15 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Window FadeIn nice bug
In addition to Touch.eat please also update to today's engine version, I've made a small improvement to this issue.
05-25-2017 06:40 AM
Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #5
RE: Window FadeIn nice bug
I updated EE and it works now whenever i use eat() or not, thank you veru much!
05-25-2017 07:15 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply