StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.
| 1 | use strato_core::types::{Color, Rect, Transform}; |
| 2 | |
| 3 | /// High-level rendering commands for the UI engine. |
| 4 | /// These are backend-agnostic and declarative. |
| 5 | #[derive(Debug, Clone)] |
| 6 | pub enum RenderCommand { |
| 7 | /// Draw a filled rectangle |
| 8 | DrawRect { |
| 9 | rect: Rect, |
| 10 | color: Color, |
| 11 | transform: Option<Transform>, |
| 12 | // TODO: Add border_radius, border_color, border_width |
| 13 | }, |
| 14 | /// Draw text string |
| 15 | DrawText { |
| 16 | text: String, |
| 17 | position: (f32, f32), |
| 18 | color: Color, |
| 19 | font_size: f32, |
| 20 | align: strato_core::text::TextAlign, |
| 21 | }, |
| 22 | /// Push a clipping rectangle |
| 23 | PushClip(Rect), |
| 24 | /// Pop the last clipping rectangle |
| 25 | PopClip, |
| 26 | /// Set a custom viewport |
| 27 | SetViewport(Rect), |
| 28 | } |
| 29 |