diff options
Diffstat (limited to 'src/game.c')
| -rw-r--r-- | src/game.c | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -45,6 +45,21 @@ void resetScreenScale(Game* game) } } +FocusCommand testFloatingWindowCallback(FloatingWindow* window, Game* game) +{ + DrawText("test", window->rect.x + 10, + window->rect.y + 10 + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT, 15, BLUE); + + if (GuiButton((Rectangle){window->rect.x + 10.0, window->rect.y + 50.0, + 40.0, 20.0}, "A")) + { + puts("hi"); + return DEMAND_FOCUS; + } + + return NO_FOCUS_ACTION; +} + void initGame(Game* game) { game->sceneId = GAME_SCENE; @@ -91,6 +106,7 @@ void initGame(Game* game) window = createFloatingWindow("test2", (Rectangle){200.0, 200.0, 100.0, 100.0}); + window.callback = testFloatingWindowCallback; addWindowToWindowManager(&game->wm, window); window = createFloatingWindow("test3", @@ -142,11 +158,6 @@ void drawGameScreen(Game* game) } } -void updateGameUI(Game* game) -{ - updateWindowManager(&game->wm); -} - void updateGameScene(Game* game) { // Handle toggle cursor. @@ -183,7 +194,7 @@ void updateGameScene(Game* game) drawGameScreen(game); - updateGameUI(game); + updateWindowManager(&game->wm, game); } void handleGameResize(Game* game) |
