so today i tried making a thing where i click somewhere and it renders a filled rect, but its pretty buggy and doesnt work.
when i click on that position, i need to keep holding on the click in order so the rect gets rendered and if i get the cursor out of that position the filled rect doesnt gets rendered anymore
this is the code
if ((cursor.x > position) && (cursor.x < position + w) && (cursor.y > y) && (cursor.y < y + h) && GetAsyncKeyState(VK_LBUTTON)) open = !open;
this its literally the same code as other menu functions uses like checkbox or the slider.
then i just check
if (open) { *my stuff* }
and it works but i need to hold my click on the position so the filled rect renders? i've been trying to figure this out for like 4 hours.
so today i tried making a thing where i click somewhere and it renders a filled rect, but its pretty buggy and doesnt work.
when i click on that position, i need to keep holding on the click in order so the rect gets rendered and if i get the cursor out of that position the filled rect doesnt gets rendered anymore
this is the code
if ((cursor.x > position) && (cursor.x < position + w) && (cursor.y > y) && (cursor.y < y + h) && GetAsyncKeyState(VK_LBUTTON)) open = !open;
this its literally the same code as other menu functions uses like checkbox or the slider.then i just check
if (open) { *my stuff* }
and it works but i need to hold my click on the position so the filled rect renders? i've been trying to figure this out for like 4 hours.