Skip to main content

Type aliases

Every Clay type has a CC_ name, so app code never needs to spell Clay_. Use them for variables, casts and function signatures.

Each is a #define onto the Clay type, so the two spellings are interchangeable.

Example​

static CC_Color accent = { 45, 108, 223, 255 };
static CC_Padding card_padding = { 16, 16, 12, 12 }; // left, right, top, bottom

static void print_box(CC_BoundingBox bb) {
printf("%.0f x %.0f at (%.0f, %.0f)\n", bb.width, bb.height, bb.x, bb.y);
}

static void inspect(void) {
CC_ElementData d = CC_ElementDataOf("Card");
if (d.found) print_box(d.boundingBox);
}

Reference​

ccomposeClayUsed for
CC_ElementDeclaration, CC_DeclClay_ElementDeclarationEvery container's fields
CC_LayoutConfigClay_LayoutConfig.layout
CC_LayoutDirectionClay_LayoutDirection.layout.layoutDirection, Element
CC_Sizing, CC_SizingAxis, CC_SizingTypeClay_Sizing, Clay_SizingAxis, Clay__SizingType.layout.sizing
CC_PaddingClay_Padding.layout.padding
CC_ChildAlignment, CC_LayoutAlignmentX, CC_LayoutAlignmentYClay_ChildAlignment, ….layout.childAlignment
CC_CornerRadiusClay_CornerRadius.cornerRadius
CC_BorderElementConfig, CC_BorderWidthClay_BorderElementConfig, Clay_BorderWidth.border
CC_TextElementConfig, CC_TextStyleClay_TextElementConfigText fields
CC_TextElementConfigWrapMode, CC_TextAlignmentClay_TextElementConfigWrapMode, Clay_TextAlignment.wrapMode, .textAlignment
CC_ImageElementConfigClay_ImageElementConfig.image
CC_FloatingElementConfig, CC_FloatingAttachToElementClay_FloatingElementConfig, ….floating
CC_ClipElementConfigClay_ClipElementConfig.clip
CC_AspectRatioElementConfigClay_AspectRatioElementConfig.aspectRatio
CC_CustomElementConfigClay_CustomElementConfig.custom
CC_TransitionElementConfig, CC_TransitionData, CC_TransitionArgs, CC_TransitionProperty, CC_TransitionState, CC_TransitionEnterTrigger, CC_TransitionExitTrigger, CC_TransitionInteraction, CC_ExitTransitionOrderingClay_Transition….transition and easing callbacks
CC_ColorClay_Color{r, g, b, a} floats, 0 to 255
CC_StringClay_String{length, chars}
CC_DimensionsClay_Dimensions{width, height}
CC_Vector2Clay_Vector2{x, y}
CC_BoundingBoxClay_BoundingBox{x, y, width, height}, passed to CC_DrawFn
CC_ElementIdClay_ElementIdHashed element id
CC_ErrorDataClay_ErrorDataError handler argument
CC_ElementDataClay_ElementData{boundingBox, found}, from CC_ElementDataOf
CC_PointerCaptureModeClay_PointerCaptureMode.floating.pointerCaptureMode
CC_RenderCommand, CC_RenderCommandArrayClay_RenderCommand, Clay_RenderCommandArrayWhat CC_End returns
CC_RenderCommandArray_GetClay_RenderCommandArray_GetIndex into the array