Hi guys havent been here for a while , was busy at work , so now was able to find free minute to code , have opened my last project and found a note about click system that is not working properly , its actually click system for GUI not sure if i should be dealing this for whole framework or keep with guy. So problem the same as you usually have with keyboard , you press a key once to go left but he will go more then once squire because of FPS , same with mouse click , i hit it once but because of high FPS its runs like 10 times or even more , so its not working properly .So was thinking to fix this over gui because not sure if i will be using this anywhere else , if you think that i should be dealing over whole framework , fixing this issue in a Mouse class , tell me please .
So my GUI system works like this gui manager have 3 functions for handling a elements : Draw, MouseHandler, KeyboardHandler . in this specific case we only need to look at MouseHandler .
so its works pretty simple this function handles all mouse event stack in mouse class , and calling it for each of GUI elements callbacks .
there is actually two callbacks witch are related : OnLeftPressed , OnLeftReleased ;
and those callback have been called based on event .
This is GUIElement witch is entity class for each elements and almost all clicks are managing the same , only specific elements have been overriding those
so the problem is obvious . and i cant think of anything good to solve it , Chili was saying me something long time ago but i have forgot
. What i was thinking is to add one more Bool variable witch is "Clicked" and then
and
Code: Select all
OnLeftRelease(){ if(IsHover() && Click){ Clicked = true;} }
i guess that would work(maybe) , but the problem is that Clicked will never been reset to false in this case so , this solution is not work . need your advice on how to solve this thing . PS sorr for no GitHub