This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use gc::{Finalize as GcFinalize, Gc, Trace as GcTrace}; | |
use intuicio_core::prelude::*; | |
use intuicio_derive::*; | |
#[intuicio_function(module_name = "test")] | |
fn add(a: Gc<i32>, b: Gc<i32>) -> Gc<i32> { | |
let c = *a + *b; | |
println!("add | {} + {} = {}", *a, *b, c); | |
Gc::new(c) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const FOO_VIEW_MODEL: &str = "foo"; | |
const COUNTER_PROPERTY: &str = "counter"; | |
const FLAG_PROPERTY: &str = "flag"; | |
// view-model data type | |
struct Foo { | |
// can hold view-model value wrapper that implicitly notifies on mutation. | |
counter: ViewModelValue<usize>, | |
// or can hold raw notifiers to explicitly notify. | |
flag: bool, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use raui::prelude::*; | |
use raui_quick_start::{ | |
tetra::{input::Key, Event}, | |
RauiQuickStartBuilder, | |
}; | |
// Name of View-Model instance. | |
const DATA: &str = "data"; | |
// Name of View-Model property notification. | |
const COUNTER: &str = "counter"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use raui::prelude::*; | |
use raui_quick_start::RauiQuickStartBuilder; | |
use std::any::Any; | |
#[derive(Default)] | |
struct AppView { | |
pub icons: View<ListView<IconView>>, | |
} | |
impl ViewState for AppView { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example of retained mode UI on top of RAUI. | |
// It's goals are very similar to Unreal's UMG on top of Slate. | |
// Evolution of this approach allows to use retained mode views | |
// within declarative mode widgets and vice versa - they | |
// interleave quite seamingly. | |
use raui::prelude::*; | |
use raui_quick_start::RauiQuickStartBuilder; | |
use raui_retained::*; | |
use std::any::Any; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example of immediate mode UI on top of RAUI. | |
// It's goal is to bring more ergonomics to RAUI by hiding | |
// declarative interface under simple nested function calls. | |
// As with retained mode, immediate mode UI can be mixed with | |
// declarative mode and retained mode widgets. | |
use raui_immediate::{make_widgets, ImmediateContext}; | |
use raui_quick_start::RauiQuickStartBuilder; | |
const FONT: &str = "./demos/hello-world/resources/verdana.ttf"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make sure you have seen `immediate_mode` code example first, because this is a continuation of that. | |
use raui_immediate::{make_widgets, ImmediateContext}; | |
use raui_quick_start::RauiQuickStartBuilder; | |
const FONT: &str = "./demos/hello-world/resources/verdana.ttf"; | |
mod gui { | |
use raui_immediate::*; | |
use raui_immediate_widgets::prelude::*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[allow(unused_imports)] | |
use raui_app::prelude::*; | |
use raui_immediate::*; | |
mod gui { | |
use raui_immediate::*; | |
use raui_immediate_widgets::prelude::*; | |
pub fn app() { | |
nav_content_box((), || { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use hecs::World; | |
use intuicio_core::prelude::*; | |
use intuicio_data::{ | |
lifetime::Lifetime, | |
managed::{ManagedRef, ManagedRefMut}, | |
}; | |
use intuicio_derive::*; | |
#[derive(IntuicioStruct, Default)] | |
struct Health { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use intuicio_core::prelude::*; | |
use intuicio_data::prelude::*; | |
use intuicio_derive::*; | |
use intuicio_framework_text::{Name, Text}; | |
use std::collections::HashMap; | |
#[derive(IntuicioStruct, Debug, Default)] | |
#[intuicio(module_name = "test")] | |
struct Loc { | |
#[intuicio(ignore)] |