Working on redoing menu ui.
This commit is contained in:
@ -7,7 +7,8 @@
|
||||
|
||||
#include "sandboxscene.h"
|
||||
|
||||
grid_t grid;
|
||||
menuv2_t menu;
|
||||
|
||||
|
||||
void gridTest(
|
||||
void *user, int32_t i,
|
||||
@ -23,14 +24,17 @@ void gridTest(
|
||||
}
|
||||
|
||||
bool sandboxSceneInit(sandboxscene_t *game) {
|
||||
gridInit(&grid);
|
||||
grid.user = (void *)game;
|
||||
menu2Init(&menu);
|
||||
gridAddBreakpoint(&menu.grid, -1, 3, 1, 0, 0);
|
||||
gridchild_t *child = gridAddChild(&menu.grid);
|
||||
gridChildAddBreakpoint(child, 0,0, 1,1);
|
||||
|
||||
gridAddBreakpoint(&grid, 800, 2, 2, 8.0f, 8.0f);
|
||||
gridAddBreakpoint(&grid, -1, 6, 6, 16.0f, 16.0f);
|
||||
child = gridAddChild(&menu.grid);
|
||||
gridChildAddBreakpoint(child, 0,1, 1,1);
|
||||
|
||||
child = gridAddChild(&menu.grid);
|
||||
gridChildAddBreakpoint(child, 0,2, 1,1);
|
||||
|
||||
gridchild_t *child = gridAddChild(&grid);
|
||||
child->onResize = &gridTest;
|
||||
|
||||
assetTextureLoad(&game->texture, "test_texture.png");
|
||||
assetShaderLoad(&game->shader,
|
||||
@ -45,6 +49,9 @@ bool sandboxSceneInit(sandboxscene_t *game) {
|
||||
}
|
||||
|
||||
void sandboxSceneUpdate(sandboxscene_t *game, engine_t *engine) {
|
||||
|
||||
|
||||
|
||||
cameraLookAt(&game->camera,
|
||||
0, 0, 10,
|
||||
0, 0, 0
|
||||
@ -60,11 +67,18 @@ void sandboxSceneUpdate(sandboxscene_t *game, engine_t *engine) {
|
||||
shaderUseCamera(&game->shader, &game->camera);
|
||||
shaderUseTexture(&game->shader, &game->texture);
|
||||
|
||||
gridSetSize(&grid,
|
||||
menu2Update(&menu, engine);
|
||||
gridSetSize(&menu.grid,
|
||||
engine->render.width, engine->render.height,
|
||||
engine->render.width, engine->render.height,
|
||||
0, 0
|
||||
);
|
||||
|
||||
// gridSetSize(&grid,
|
||||
// engine->render.width, engine->render.height,
|
||||
// engine->render.width, engine->render.height,
|
||||
// 0, 0
|
||||
// );
|
||||
|
||||
|
||||
for(uint8_t i = 0; i < GRID_BRUH_COUNT; i++) {
|
||||
|
@ -16,7 +16,9 @@
|
||||
#include "../../display/renderlist.h"
|
||||
#include "../../display/texture.h"
|
||||
#include "../../file/asset.h"
|
||||
|
||||
#include "../../ui/grid.h"
|
||||
#include "../../ui/menuv2.h"
|
||||
|
||||
/**
|
||||
* Initialize the sandbox scene test game.
|
||||
|
Reference in New Issue
Block a user