From 7cc719e61f70c70ec7a011ec4e357051c1aa5e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Styrbj=C3=B6rn?= Date: Wed, 8 Jan 2025 21:56:24 +0100 Subject: [PATCH] [Documentation] Updated example for Clay_SetPointerState (#169) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2d19696..6663a79 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ Clay_RenderCommandArray CreateLayout() { CLAY_RECTANGLE({ .color = COLOR_LIGHT }) ) { CLAY(CLAY_ID("ProfilePictureOuter"), CLAY_LAYOUT({ .sizing = { .width = CLAY_SIZING_GROW() }, .padding = {16, 16}, .childGap = 16, .childAlignment = { .y = CLAY_ALIGN_Y_CENTER }), CLAY_RECTANGLE({ .color = COLOR_RED })) { - CLAY(CLAY_ID("ProfilePicture"), CLAY_LAYOUT({ .sizing = { .width = CLAY_SIZING_FIXED(60), .height = CLAY_SIZING_FIXED(60) }}), CLAY_IMAGE({ .imageData = &profilePicture, .height = 60, .width = 60 })) {} + CLAY(CLAY_ID("ProfilePicture"), CLAY_LAYOUT({ .sizing = { .width = CLAY_SIZING_FIXED(60), .height = CLAY_SIZING_FIXED(60) }}), CLAY_IMAGE({ .imageData = &profilePicture, .sourceDimensions = {60, 60} })) {} CLAY_TEXT(CLAY_STRING("Clay - UI Library"), CLAY_TEXT_CONFIG({ .fontSize = 24, .textColor = {255, 255, 255, 255} })); } @@ -1059,11 +1059,11 @@ CLAY(CLAY_IMAGE({ .image = { .format = IMAGE_FORMAT_RGBA, .internalData = &image // Load an image somewhere in your code Image profilePicture = LoadImage("profilePicture.png"); // Declare a reusable image config -Clay_ImageElementConfig imageConfig = (Clay_ImageElementConfig) { .imageData = &profilePicture, .height = 60, .width = 60 }; +Clay_ImageElementConfig imageConfig = (Clay_ImageElementConfig) { .imageData = &profilePicture, .sourceDimensions = {60, 60} }; // Declare an image element using a reusable config CLAY(CLAY_IMAGE(imageConfig)) {} // Declare an image element using an inline config -CLAY(CLAY_IMAGE({ .imageData = &profilePicture, .height = 60, .width = 60 })) {} +CLAY(CLAY_IMAGE({ .imageData = &profilePicture, .sourceDimensions = {60, 60} })) {} // Rendering example Image *imageToRender = renderCommand->elementConfig.imageElementConfig->imageData; ```