28 lines
1.1 KiB
Ziran
28 lines
1.1 KiB
Ziran
LoadingIndicator :: #import "kryon/loading_indicator";
|
|
Text :: #import "kryon/text";
|
|
#import "kryon/geometry"
|
|
#import "kryon/session"
|
|
#import "kryon/frame_snapshot"
|
|
DemoTheme :: #import "kryon/Theme";
|
|
|
|
|
|
#program_export
|
|
Frame :: (session: Session, viewport: Rectangle) -> s32 {
|
|
Text.Draw(session, Text.Props.{.disabled = example_disabled, .key = 1, .bounds = .{viewport.x + 20.0, viewport.y + 16.0, viewport.width - 40.0, 40.0}, .text = "Loading indicator", .size = 28})
|
|
bounds := Rectangle.{viewport.x + 20.0, viewport.y + 76.0, viewport.width - 40.0, 180.0}
|
|
input := CaptureFrameInput(session)
|
|
now := cast(float64)input.elapsed_ms / 1000.0
|
|
LoadingIndicator.Draw(session, LoadingIndicator.Props.{.key = 10, .bounds = bounds, .now = ifx (example_reduced_motion || DemoTheme.CurrentTheme().motion.reduced_motion) then 0.0 else now, .scale = 1.0})
|
|
return 0
|
|
}
|
|
|
|
example_disabled: bool;
|
|
example_reduced_motion: bool;
|
|
|
|
// Hosts publish these options before the unchanged application entry point.
|
|
#program_export
|
|
SetExampleOptions :: (disabled: bool, reduced_motion: bool) {
|
|
example_disabled = disabled
|
|
example_reduced_motion = reduced_motion
|
|
}
|