mirror of
https://github.com/nicbarker/clay.git
synced 2025-05-09 11:58:05 +00:00
[Bindings/Odin] Updated odin bindings with new clip config (#397)
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
Great work, thanks for moving on this so quickly! 😁
This commit is contained in:
parent
90b45f059c
commit
e4e7b113a9
@ -103,7 +103,7 @@ TextAlignment :: enum EnumBackingType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TextElementConfig :: struct {
|
TextElementConfig :: struct {
|
||||||
userData: rawptr,
|
userData: rawptr,
|
||||||
textColor: Color,
|
textColor: Color,
|
||||||
fontId: u16,
|
fontId: u16,
|
||||||
fontSize: u16,
|
fontSize: u16,
|
||||||
@ -135,9 +135,10 @@ BorderElementConfig :: struct {
|
|||||||
width: BorderWidth,
|
width: BorderWidth,
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollElementConfig :: struct {
|
ClipElementConfig :: struct {
|
||||||
horizontal: bool,
|
horizontal: bool, // clip overflowing elements on the "X" axis
|
||||||
vertical: bool,
|
vertical: bool, // clip overflowing elements on the "Y" axis
|
||||||
|
childOffset: Vector2, // offsets the [X,Y] positions of all child elements, primarily for scrolling containers
|
||||||
}
|
}
|
||||||
|
|
||||||
FloatingAttachPointType :: enum EnumBackingType {
|
FloatingAttachPointType :: enum EnumBackingType {
|
||||||
@ -235,7 +236,7 @@ ScrollContainerData :: struct {
|
|||||||
scrollPosition: ^Vector2,
|
scrollPosition: ^Vector2,
|
||||||
scrollContainerDimensions: Dimensions,
|
scrollContainerDimensions: Dimensions,
|
||||||
contentDimensions: Dimensions,
|
contentDimensions: Dimensions,
|
||||||
config: ScrollElementConfig,
|
config: ClipElementConfig,
|
||||||
// Indicates whether an actual scroll container matched the provided ID or if the default struct was returned.
|
// Indicates whether an actual scroll container matched the provided ID or if the default struct was returned.
|
||||||
found: bool,
|
found: bool,
|
||||||
}
|
}
|
||||||
@ -329,16 +330,16 @@ ClayArray :: struct($type: typeid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ElementDeclaration :: struct {
|
ElementDeclaration :: struct {
|
||||||
id: ElementId,
|
id: ElementId,
|
||||||
layout: LayoutConfig,
|
layout: LayoutConfig,
|
||||||
backgroundColor: Color,
|
backgroundColor: Color,
|
||||||
cornerRadius: CornerRadius,
|
cornerRadius: CornerRadius,
|
||||||
image: ImageElementConfig,
|
image: ImageElementConfig,
|
||||||
floating: FloatingElementConfig,
|
floating: FloatingElementConfig,
|
||||||
custom: CustomElementConfig,
|
custom: CustomElementConfig,
|
||||||
scroll: ScrollElementConfig,
|
clip: ClipElementConfig,
|
||||||
border: BorderElementConfig,
|
border: BorderElementConfig,
|
||||||
userData: rawptr,
|
userData: rawptr,
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorType :: enum EnumBackingType {
|
ErrorType :: enum EnumBackingType {
|
||||||
@ -385,6 +386,7 @@ foreign Clay {
|
|||||||
Hovered :: proc() -> bool ---
|
Hovered :: proc() -> bool ---
|
||||||
OnHover :: proc(onHoverFunction: proc "c" (id: ElementId, pointerData: PointerData, userData: rawptr), userData: rawptr) ---
|
OnHover :: proc(onHoverFunction: proc "c" (id: ElementId, pointerData: PointerData, userData: rawptr), userData: rawptr) ---
|
||||||
PointerOver :: proc(id: ElementId) -> bool ---
|
PointerOver :: proc(id: ElementId) -> bool ---
|
||||||
|
GetScrollOffset :: proc() -> Vector2 ---
|
||||||
GetScrollContainerData :: proc(id: ElementId) -> ScrollContainerData ---
|
GetScrollContainerData :: proc(id: ElementId) -> ScrollContainerData ---
|
||||||
SetMeasureTextFunction :: proc(measureTextFunction: proc "c" (text: StringSlice, config: ^TextElementConfig, userData: rawptr) -> Dimensions, userData: rawptr) ---
|
SetMeasureTextFunction :: proc(measureTextFunction: proc "c" (text: StringSlice, config: ^TextElementConfig, userData: rawptr) -> Dimensions, userData: rawptr) ---
|
||||||
SetQueryScrollOffsetFunction :: proc(queryScrollOffsetFunction: proc "c" (elementId: u32, userData: rawptr) -> Vector2, userData: rawptr) ---
|
SetQueryScrollOffsetFunction :: proc(queryScrollOffsetFunction: proc "c" (elementId: u32, userData: rawptr) -> Vector2, userData: rawptr) ---
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -451,7 +451,7 @@ createLayout :: proc(lerpValue: f32) -> clay.ClayArray(clay.RenderCommand) {
|
|||||||
if clay.UI()({ id = clay.ID("TopBorder5"), layout = { sizing = { clay.SizingGrow({ }), clay.SizingFixed(4) } }, backgroundColor = COLOR_TOP_BORDER_1 } ) {}
|
if clay.UI()({ id = clay.ID("TopBorder5"), layout = { sizing = { clay.SizingGrow({ }), clay.SizingFixed(4) } }, backgroundColor = COLOR_TOP_BORDER_1 } ) {}
|
||||||
if clay.UI()({
|
if clay.UI()({
|
||||||
id = clay.ID("ScrollContainerBackgroundRectangle"),
|
id = clay.ID("ScrollContainerBackgroundRectangle"),
|
||||||
scroll = { vertical = true },
|
clip = { vertical = true, childOffset = clay.GetScrollOffset() },
|
||||||
layout = { sizing = { clay.SizingGrow({ }), clay.SizingGrow({ }) }, layoutDirection = clay.LayoutDirection.TopToBottom },
|
layout = { sizing = { clay.SizingGrow({ }), clay.SizingGrow({ }) }, layoutDirection = clay.LayoutDirection.TopToBottom },
|
||||||
backgroundColor = COLOR_LIGHT,
|
backgroundColor = COLOR_LIGHT,
|
||||||
border = { COLOR_RED, { betweenChildren = 2} },
|
border = { COLOR_RED, { betweenChildren = 2} },
|
||||||
|
Loading…
Reference in New Issue
Block a user