mirror of
https://github.com/nicbarker/clay.git
synced 2025-05-14 14:28:06 +00:00
Compare commits
3 Commits
8bc66662d2
...
fed5087d96
Author | SHA1 | Date | |
---|---|---|---|
|
fed5087d96 | ||
|
dcd6feda86 | ||
|
b4102400ff |
@ -339,6 +339,8 @@ ErrorHandler :: struct {
|
|||||||
userData: rawptr
|
userData: rawptr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Context :: struct {} // opaque structure, only use as a pointer
|
||||||
|
|
||||||
@(link_prefix = "Clay_", default_calling_convention = "c")
|
@(link_prefix = "Clay_", default_calling_convention = "c")
|
||||||
foreign Clay {
|
foreign Clay {
|
||||||
MinMemorySize :: proc() -> u32 ---
|
MinMemorySize :: proc() -> u32 ---
|
||||||
@ -349,12 +351,15 @@ foreign Clay {
|
|||||||
SetLayoutDimensions :: proc(dimensions: Dimensions) ---
|
SetLayoutDimensions :: proc(dimensions: Dimensions) ---
|
||||||
BeginLayout :: proc() ---
|
BeginLayout :: proc() ---
|
||||||
EndLayout :: proc() -> ClayArray(RenderCommand) ---
|
EndLayout :: proc() -> ClayArray(RenderCommand) ---
|
||||||
|
Hovered :: proc() -> bool ---
|
||||||
PointerOver :: proc(id: ElementId) -> bool ---
|
PointerOver :: proc(id: ElementId) -> bool ---
|
||||||
GetElementId :: proc(id: String) -> ElementId ---
|
GetElementId :: proc(id: String) -> ElementId ---
|
||||||
GetScrollContainerData :: proc(id: ElementId) -> ScrollContainerData ---
|
GetScrollContainerData :: proc(id: ElementId) -> ScrollContainerData ---
|
||||||
SetMeasureTextFunction :: proc(measureTextFunction: proc "c" (text: StringSlice, config: ^TextElementConfig, userData: uintptr) -> Dimensions, userData: uintptr) ---
|
SetMeasureTextFunction :: proc(measureTextFunction: proc "c" (text: StringSlice, config: ^TextElementConfig, userData: uintptr) -> Dimensions, userData: uintptr) ---
|
||||||
RenderCommandArray_Get :: proc(array: ^ClayArray(RenderCommand), index: i32) -> ^RenderCommand ---
|
RenderCommandArray_Get :: proc(array: ^ClayArray(RenderCommand), index: i32) -> ^RenderCommand ---
|
||||||
SetDebugModeEnabled :: proc(enabled: bool) ---
|
SetDebugModeEnabled :: proc(enabled: bool) ---
|
||||||
|
GetCurrentContext :: proc() -> ^Context ---
|
||||||
|
SetCurrentContext :: proc(ctx: ^Context) ---
|
||||||
}
|
}
|
||||||
|
|
||||||
@(link_prefix = "Clay_", default_calling_convention = "c", private)
|
@(link_prefix = "Clay_", default_calling_convention = "c", private)
|
||||||
|
@ -438,7 +438,7 @@ createLayout :: proc(lerpValue: f32) -> clay.ClayArray(clay.RenderCommand) {
|
|||||||
id = clay.ID("LinkGithubOuter"),
|
id = clay.ID("LinkGithubOuter"),
|
||||||
layout = { padding = { 16, 16, 6, 6 } },
|
layout = { padding = { 16, 16, 6, 6 } },
|
||||||
border = border2pxRed,
|
border = border2pxRed,
|
||||||
backgroundColor = clay.PointerOver(clay.GetElementId(clay.MakeString("LinkGithubOuter"))) ? COLOR_LIGHT_HOVER : COLOR_LIGHT,
|
backgroundColor = clay.Hovered() ? COLOR_LIGHT_HOVER : COLOR_LIGHT,
|
||||||
cornerRadius = clay.CornerRadiusAll(10)
|
cornerRadius = clay.CornerRadiusAll(10)
|
||||||
}) {
|
}) {
|
||||||
clay.Text("Github", clay.TextConfig({fontId = FONT_ID_BODY_24, fontSize = 24, textColor = {61, 26, 5, 255}}))
|
clay.Text("Github", clay.TextConfig({fontId = FONT_ID_BODY_24, fontSize = 24, textColor = {61, 26, 5, 255}}))
|
||||||
|
Loading…
Reference in New Issue
Block a user