Is using GuiDropdownBox with Camera2D supported? #3129
Replies: 3 comments
-
I took a look at this, and saw GuiDropDownBox uses: |
Beta Was this translation helpful? Give feedback.
-
I haven't tested it but I think you can use |
Beta Was this translation helpful? Give feedback.
-
I used this in my application, Note that it dose not support zooming, but that can likely be added with the BeginDrawing();
ClearBackground(RAYWHITE);
BeginMode2D(camera);
SetMouseOffset((int)camera.target.X, (int)camera.target.Y);
var mp = GetMousePosition();
DrawCircle((int)mp.X, (int)mp.Y, 5, RED);
if (GuiButton(new Rectangle(0, 0, 128, 24), "Some Button")) { }
SetMouseOffset(0, 0);
EndMode2D();
// HUD ---------------
if (GuiButton(new Rectangle(0, 0, 128, 24), "Some Button")) { }
EndDrawing(); (note that this example is with the C# bindings) |
Beta Was this translation helpful? Give feedback.
-
I've written the following test to draw a
GuiDropdownBox
and then move theCamera2D
by pressing the right mouse button and moving the mouse.When the mouse moves and the camera target changes, the hitbox for triggering the drop down box remains at pos 0,0 and so becomes disconnected from where the control is actually being drawn on screen. Is there anyway to use
Camera2D
with gui controls and have them work as expected?This example uses Go bindings.
Beta Was this translation helpful? Give feedback.
All reactions