7 个版本
0.1.19 | 2023 年 11 月 25 日 |
---|---|
0.1.18 | 2023 年 11 月 2 日 |
0.1.17 | 2023 年 10 月 31 日 |
146 在 多媒体 分类中
165KB
3K SLoC
Agera SDK API
此包提供了用于开发丰富互联网应用程序的 Agera SDK API。
lib.rs
:
编写 Agera 丰富互联网应用程序的基础 API。
基础知识
Agera 应用程序可以通过 Agera 命令行界面或集成开发环境创建。Rust 程序应包含以下 use
项
use agera::common::*;
节点
Agera 使用 util::inheritance
模块来使用节点图。您可以定义自己的类,这些类扩展了其他节点类。
图形体验
使用 agera::display
和 agera::controls
模块将图形和控件显示到屏幕上。Agera 支持对显示对象的深入设置,例如注册点和过滤器,以及如对象边界测量等操作。
处理文件
agera::file
模块提供通过路径或引用操作文件的方式。它抽象了属于应用程序的文件的工作方式。
use agera::file::*;
// A file path
let file = File::new("app://asset.svg");
// Synchronous operation
println!("{}", file.exists());
// Asynchronous operation
println!("{}", file.exists_async().await);
处理事件
事件条件通常表示为 EventEmitter
对象,程序员可以使用 .listener
方法将其附加到监听器。
// Registering listener
let listener = button.on_click().listener(|e| {
// Action
});
// Removing listener
listener.remove();
依赖项
~6–20MB
~270K SLoC