OlR Posted Saturday at 03:44 AM Posted Saturday at 03:44 AM On the attached project I setup a interface with some buttons on the GameUi.lua, this interface has a listener on one of its buttons for the EVENT_MOUSEENTER and EVENT_MOUSELEAVE events. When the mouse enters the area of the button it keeps firing non stop the EVENT_MOUSEENTER event while the mouse is moving inside the button area. I've tested this for different buttons and different widgets and looks like only buttons has this behavior. Below I've sent my project attached and video evidence AuroraStudy.zip Quote
Josh Posted 7 hours ago Posted 7 hours ago I am using this example to test with: #include "Leadwerks.h" using namespace Leadwerks; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Leadwerks", 0, 0, 640, 480, displays[0], WINDOW_TITLEBAR | WINDOW_CENTER); //Create User Interface auto ui = CreateInterface(window); //Create buttons int x = (window->ClientSize().x - 120) / 2; int y = 50; int sep = 40; auto button = CreateButton("Button", x, y, 120, 30, ui->root); while (true) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_MOUSEENTER: if (ev.source == button) { window->SetText(String(Random(100))); } break; case EVENT_WIDGETACTION: Print(ev.source->As<Widget>()->text); break; case EVENT_WINDOWCLOSE: return 0; break; } } return 0; } Quote Let's build cool stuff and have fun.
Solution Josh Posted 7 hours ago Solution Posted 7 hours ago I found some code that triggers this event whenever the mouse moves. This might have been in there to fix some other small issue. I will change it back, and we can just wait and see if it causes any problems with that code removed. 1 Quote Let's build cool stuff and have fun.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.