#imgui checkbox
47 messages · Page 1 of 1 (latest)
could you share the code please?
id need your code for that
ImGui::SetCursorPos(ImVec2(8.000f, 109.000f));
ImGui::Checkbox("Inf Fuel", &fuel);
would it go under there
if (ImGui::Checkbox("Inf Fuel", &fuel);
if (ImGui::IsKeyPressed(/*the key you want to use*/))
fuel != fuel;
windows and linux use SDL2 keycodes, you can look them up
but generally SDL_SCANCODE_A for example will work
so if i wanted the key to be F1 what would i put
just do IsKeyPressed(SDL_SCANCODE_F1)
no point in converting keycodes theyre already defined in the header
included the header?
nope
do that
bro wtf is this
there is so many files and folders
@weak cypress these?
@weak cypress i got the headers in but now the key doesnt actually disable and enable the checkbox
oh sorry, they shouldnt be linked to one another
if (ImGui::Checkbox("Inf Fuel", &fuel));
if (ImGui::IsKeyPressed(SDL_SCANCODE_F1))
fuel != fuel;
if (ImGui::Checkbox("Inf Fuel", &fuel);
{
//your logic here
}
if (ImGui::IsKeyPressed(/SDL_SCANCODE_F1))
fuel != fuel;
try that
this has many errors
@weak cypress yeah im pasting in the same code and fixing it then the F1 key does nothing
The is key pressed should be running in your main loop. Not in the render function
what
if (ImGui::Checkbox("Inf Fuel", &fuel));
{
}
if (ImGui::IsKeyPressed(SDL_SCANCODE_F1))
fuel != fuel;
like this??
my whole screen is now gone
this is all of it @weak cypress
i found another way of doing it