diff --git a/README.md b/README.md index 8e1c334..f6058b6 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ int main() { .id = CLAY_ID("SideBar"), .layout = { .layoutDirection = CLAY_TOP_TO_BOTTOM, .sizing = { .width = CLAY_SIZING_FIXED(300), .height = CLAY_SIZING_GROW(0) }, .padding = CLAY_PADDING_ALL(16), .childGap = 16 }, .backgroundColor = COLOR_LIGHT } - ) { + }) { CLAY({ .id = CLAY_ID("ProfilePictureOuter"), .layout = { .sizing = { .width = CLAY_SIZING_GROW(0) }, .padding = CLAY_PADDING_ALL(16), .childGap = 16, .childAlignment = { .y = CLAY_ALIGN_Y_CENTER } }, .backgroundColor = COLOR_RED }) { CLAY({ .id = CLAY_ID("ProfilePicture"), .layout = { .sizing = { .width = CLAY_SIZING_FIXED(60), .height = CLAY_SIZING_FIXED(60) }}, .image = { .imageData = &profilePicture, .sourceDimensions = {60, 60} } }) {} CLAY_TEXT(CLAY_STRING("Clay - UI Library"), CLAY_TEXT_CONFIG({ .fontSize = 24, .textColor = {255, 255, 255, 255} })); @@ -103,22 +103,20 @@ int main() { CLAY({ .id = CLAY_ID("MainContent"), .layout = { .sizing = { .width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_GROW(0) } }, .backgroundColor = COLOR_LIGHT }) {} } + } - // All clay layouts are declared between Clay_BeginLayout and Clay_EndLayout - Clay_RenderCommandArray renderCommands = Clay_EndLayout(); + // All clay layouts are declared between Clay_BeginLayout and Clay_EndLayout + Clay_RenderCommandArray renderCommands = Clay_EndLayout(); - // More comprehensive rendering examples can be found in the renderers/ directory - for (int i = 0; i < renderCommands.length; i++) { - Clay_RenderCommand *renderCommand = &renderCommands.internalArray[i]; + // More comprehensive rendering examples can be found in the renderers/ directory + for (int i = 0; i < renderCommands.length; i++) { + Clay_RenderCommand *renderCommand = &renderCommands.internalArray[i]; - switch (renderCommand->commandType) { - case CLAY_RENDER_COMMAND_TYPE_RECTANGLE: { - DrawRectangle( - renderCommand->boundingBox, - renderCommand->renderData.rectangle.backgroundColor); - } - // ... Implement handling of other command types + switch (renderCommand->commandType) { + case CLAY_RENDER_COMMAND_TYPE_RECTANGLE: { + DrawRectangle( renderCommand->boundingBox, renderCommand->renderData.rectangle.backgroundColor); } + // ... Implement handling of other command types } } }