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
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
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 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
#[test] | |
fn test_hello_world() { | |
// convenient macro that produces widget component processing function. | |
widget_component! { | |
// <component name> ( [list of context data to unpack into scope] ) | |
app(key, named_slots) { | |
// easy way to get widgets from named slots. | |
unpack_named_slots!(named_slots => { title, content }); | |
// we always return new widgets tree. |
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
// import './serialization.chrobry' | |
inject | |
``` | |
#pragma once | |
#include <string> | |
#include <sstream> | |
``` | |
extern 'int' 'float' { |
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
// calcualte position difference (a.k.a. tangent vector): | |
var dx = enemy.x - x; | |
var dy = enemy.y - y; | |
// calculate angle in radians of instance: | |
var rad = degtorad(image_angle); | |
// calculate where is instance right side (a.k.a. binormal vector): | |
var bx = -sin(rad); | |
var by = cos(rad); |
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
using I4.NET; | |
using System; | |
using System.Collections.Generic; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using UnityEngine; | |
using UnityEngine.UI; | |
namespace I4.Unity.Example | |
{ |
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
#include "library.h" | |
#ifdef BUILD_LINUX | |
#include <dlfcn.h> | |
#endif | |
#ifdef BUILD_WIN | |
#include <windows.h> | |
#endif | |
#include <map> | |
struct Handle |
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
#!/usr/bin/env i4s | |
#intuicio 4.0; | |
#stack 8k; | |
#memory 16k; | |
#entry @Main; | |
#pointersize 32; | |
#import from [IO:print] routine print(format:*i8, ...):; | |
#import from [IO:get_line_new] routine get_line_new():*i8; |