mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-24 07:08:03 +00:00
Compare commits
1 Commits
c09d6f5489
...
48496ffcc7
Author | SHA1 | Date | |
---|---|---|---|
|
48496ffcc7 |
@ -420,13 +420,7 @@ UI :: proc() -> proc (config: ElementDeclaration) -> bool {
|
|||||||
return ConfigureOpenElement
|
return ConfigureOpenElement
|
||||||
}
|
}
|
||||||
|
|
||||||
Text :: proc($text: string, config: ^TextElementConfig) {
|
Text :: proc(text: string, config: ^TextElementConfig) {
|
||||||
wrapped := MakeString(text)
|
|
||||||
wrapped.isStaticallyAllocated = true
|
|
||||||
_OpenTextElement(wrapped, config)
|
|
||||||
}
|
|
||||||
|
|
||||||
TextDynamic :: proc(text: string, config: ^TextElementConfig) {
|
|
||||||
_OpenTextElement(MakeString(text), config)
|
_OpenTextElement(MakeString(text), config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ border2pxRed := clay.BorderElementConfig {
|
|||||||
color = COLOR_RED
|
color = COLOR_RED
|
||||||
}
|
}
|
||||||
|
|
||||||
LandingPageBlob :: proc(index: u32, fontSize: u16, fontId: u16, color: clay.Color, $text: string, image: ^raylib.Texture2D) {
|
LandingPageBlob :: proc(index: u32, fontSize: u16, fontId: u16, color: clay.Color, text: string, image: ^raylib.Texture2D) {
|
||||||
if clay.UI()({
|
if clay.UI()({
|
||||||
id = clay.ID("HeroBlob", index),
|
id = clay.ID("HeroBlob", index),
|
||||||
layout = { sizing = { width = clay.SizingGrow({ max = 480 }) }, padding = clay.PaddingAll(16), childGap = 16, childAlignment = clay.ChildAlignment{ y = .Center } },
|
layout = { sizing = { width = clay.SizingGrow({ max = 480 }) }, padding = clay.PaddingAll(16), childGap = 16, childAlignment = clay.ChildAlignment{ y = .Center } },
|
||||||
@ -252,7 +252,7 @@ ColorLerp :: proc(a: clay.Color, b: clay.Color, amount: f32) -> clay.Color {
|
|||||||
return clay.Color{a.r + (b.r - a.r) * amount, a.g + (b.g - a.g) * amount, a.b + (b.b - a.b) * amount, a.a + (b.a - a.a) * amount}
|
return clay.Color{a.r + (b.r - a.r) * amount, a.g + (b.g - a.g) * amount, a.b + (b.b - a.b) * amount, a.a + (b.a - a.a) * amount}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOREM_IPSUM_TEXT :: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
LOREM_IPSUM_TEXT := "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
||||||
|
|
||||||
HighPerformancePage :: proc(lerpValue: f32, titleTextConfig: clay.TextElementConfig, widthSizing: clay.SizingAxis) {
|
HighPerformancePage :: proc(lerpValue: f32, titleTextConfig: clay.TextElementConfig, widthSizing: clay.SizingAxis) {
|
||||||
if clay.UI()({ id = clay.ID("PerformanceLeftText"), layout = { sizing = { width = widthSizing }, layoutDirection = .TopToBottom, childGap = 8 } }) {
|
if clay.UI()({ id = clay.ID("PerformanceLeftText"), layout = { sizing = { width = widthSizing }, layoutDirection = .TopToBottom, childGap = 8 } }) {
|
||||||
@ -321,7 +321,7 @@ HighPerformancePageMobile :: proc(lerpValue: f32) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RendererButtonActive :: proc(index: i32, $text: string) {
|
RendererButtonActive :: proc(index: i32, text: string) {
|
||||||
if clay.UI()({
|
if clay.UI()({
|
||||||
layout = { sizing = { width = clay.SizingFixed(300) }, padding = clay.PaddingAll(16) },
|
layout = { sizing = { width = clay.SizingFixed(300) }, padding = clay.PaddingAll(16) },
|
||||||
backgroundColor = COLOR_RED,
|
backgroundColor = COLOR_RED,
|
||||||
@ -331,7 +331,7 @@ RendererButtonActive :: proc(index: i32, $text: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RendererButtonInactive :: proc(index: u32, $text: string) {
|
RendererButtonInactive :: proc(index: u32, text: string) {
|
||||||
if clay.UI()({ border = border2pxRed }) {
|
if clay.UI()({ border = border2pxRed }) {
|
||||||
if clay.UI()({
|
if clay.UI()({
|
||||||
id = clay.ID("RendererButtonInactiveInner", index),
|
id = clay.ID("RendererButtonInactiveInner", index),
|
||||||
|
Loading…
Reference in New Issue
Block a user